realbasic-games
[Top] [All Lists]

Re: How to know if a game device element is a buton or a potenciometer

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: How to know if a game device element is a buton or a potenciometer
From: William Squires <wsquires at satx dot rr dot com>
Date: Thu, 1 Feb 2007 19:38:20 -0600
Cc:
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <45C2693E dot 6040500 at gmail dot com>
How about just calling it a 'knob' for simplicity? :) BTW, it's spelled 'potentiometer' - there is no 'c'... but I guess you 'c' that now, eh? :) If your game elements are instances of separate classes, you could use an "IsA" test. Or add a name tag to the ultimate super class from which your game instances are created, then - at creation time (in the constructor) - give them a name which can later be checked, much like the RB IDE does when you create a control; you get a control named 'PushButton1' (if you created/copied a PushButton) and so on. You could also make a method for each class, "Function ClassName() As String" that simply returns a hard-coded string containing the name of the class the method belongs to. I use this in my own object flattening (serialization) schemes so that I can check to make sure that data for an object of class "A" isn't un-flattened into an object of class "B" by mistake. I can then query objects in a container without expensive If-Then or Select-Case trees.

On Feb 1, 2007, at 4:27 PM, Rafael Vallejo GMAIL wrote:

The subject say's it all.

PD: I can only get the element's name.




*******************************************************
This message has been scanned for viruses and
dangerous content by Kypus Server Appliance E-Mail
Protection Service, and is believed to be clean.
******************************************************* =-=-=-=-=-=- =-=-=-=-=-=-Disclaimer Notice-=-=-=-=-=-=-=-=-=-=-=-=-=-=

The information in this E-mail is intended to be confidential and only for use of the individual or entity to whom it is addressed. If you are not the intended recipient, any retention, dissemination, distribution or copying of this message is strictly prohibited and sanctioned by law. If you receive this message by error, please immediately send it back and delete the message received.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-==

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>