CSE115.Fly
Class RandomStateChangeBehaviour
java.lang.Object
NGP.Timer
CSE115.Fly.RandomStateChangeBehaviour
- All Implemented Interfaces:
- ActionListener, EventListener
- public class RandomStateChangeBehaviour
- extends Timer
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RandomStateChangeBehaviour
public RandomStateChangeBehaviour(int delay)
- Creates an object of this class
- Parameters:
delay - inverse of the frequency with which states are
randomly changed
addStateChanger
public void addStateChanger(StateChanger s)
- Adds a StateChanger to the internal list
- Parameters:
s - StateChanger to be added
removeStateChanger
public void removeStateChanger(StateChanger s)
- Removes a StateChanger from internal list
- Parameters:
s - StateChanger to be removed
activate
public void activate()
- Randomly flips the state of StateChanger objects in its list.