Class Flock
java.lang.Object
|
+--AnimatedObject
|
+--Flock
- All Implemented Interfaces:
- Animatable, Paintable
- public class Flock
- extends AnimatedObject
|
Field Summary |
private java.util.Vector |
myAnimals
|
|
Constructor Summary |
Flock()
Constructor |
|
Method Summary |
private void |
AddRules(java.util.Iterator rulesIter)
Adds the rules to the flock
rulesIter iterates over the vector of rules |
void |
applyForce(Force f)
Iterators through the vector of animals and applie the force
to each animal in the flock |
void |
Create(Canvas display,
java.awt.Point start,
java.util.Iterator rulesIter)
Creates animals in the flocks |
java.util.Iterator |
iterator()
Returns an iterator over myAnimals |
void |
paint(java.awt.Graphics g)
paint
Applies paint to each boid in the flock |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
myAnimals
private java.util.Vector myAnimals
Flock
public Flock()
- Constructor
Create
public void Create(Canvas display,
java.awt.Point start,
java.util.Iterator rulesIter)
- Creates animals in the flocks
AddRules
private void AddRules(java.util.Iterator rulesIter)
- Adds the rules to the flock
rulesIter iterates over the vector of rules
iterator
public java.util.Iterator iterator()
- Returns an iterator over myAnimals
applyForce
public void applyForce(Force f)
- Iterators through the vector of animals and applie the force
to each animal in the flock
paint
public void paint(java.awt.Graphics g)
- paint
Applies paint to each boid in the flock