Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   polymorphism problem (http://www.alice.org/community/showthread.php?t=72)

margush 10-21-2005 07:17 PM

polymorphism problem
 
I have created a custom version of a robot (adding methods to walk and so on). There is a boolean property named moving. I have methods to set it true or false (startMoving, stopMoving).

I have imported three of these robots and all move randomly.

I would like to be able to start/stop a robot by clicking on it and using the object under the cursor to call the appropriate method or set the moving variable directly... of course this is impossible since these are my own custom property/methods. Can you suggest a workaround short of an object by object comparison?

There is a reference to this in the FAQ, but it is vague. Are the functions named robot's part named key and robot's variable named variableName of type valueClass of any use here? And how are these functions used? I cannot find any destination for the last one.

Thanks.


All times are GMT -5. The time now is 07:12 PM.

Copyright ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.