Alice Community

Alice Community (
-   How do I...? (
-   -   polymorphism problem (

margush 10-21-2005 08: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.


All times are GMT -5. The time now is 03:23 AM.

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