CSE115.Fly
Class RepelBehaviour
java.lang.Object
NGP.Timer
CSE115.Fly.MoveBehaviour
CSE115.Fly.RepelBehaviour
- All Implemented Interfaces:
- ActionListener, EventListener
- public class RepelBehaviour
- extends MoveBehaviour
|
Method Summary |
void |
activate()
Moves the Movables away from repelling shapes |
void |
add(Movable movable,
Shape repellingShape)
Adds to list of Movables |
void |
remove(Movable movable)
Removes from list of Movables |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RepelBehaviour
public RepelBehaviour(int delay,
Rectangle area)
- Creates an object of this class
- Parameters:
delay - inverse of speedarea - bounding area within which Movables are moved
add
public void add(Movable movable,
Shape repellingShape)
- Adds to list of Movables
- Parameters:
movable - Movable to be added
remove
public void remove(Movable movable)
- Removes from list of Movables
- Parameters:
movable - Movable to be removed
activate
public void activate()
- Moves the Movables away from repelling shapes