CSE115.Fly
Class AttractBehaviour
java.lang.Object
NGP.Timer
CSE115.Fly.MoveBehaviour
CSE115.Fly.AttractBehaviour
- All Implemented Interfaces:
- ActionListener, EventListener
- public class AttractBehaviour
- extends MoveBehaviour
Method Summary |
void |
activate()
For moving the Movables towards the attracting shapes |
void |
add(Movable movable,
Shape attractingShape)
For adding a Movable and its attracting shape to the lists |
void |
remove(Movable movable)
For removing a Movable and its attracting shape from the lists |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AttractBehaviour
public AttractBehaviour(int delay,
Rectangle area)
- Parameters:
delay
- inverse of speed of movementarea
- limits within which the Movables are to be moved
add
public void add(Movable movable,
Shape attractingShape)
- For adding a Movable and its attracting shape to the lists
- Parameters:
movable
- the MovableattractingShape
- the attracting shape
remove
public void remove(Movable movable)
- For removing a Movable and its attracting shape from the lists
- Parameters:
movable
- the Movable
activate
public void activate()
- For moving the Movables towards the attracting shapes