adding the topics as well

This commit is contained in:
benfry
2011-03-07 00:14:46 +00:00
parent 4f2985a30a
commit 43f34c8aae
441 changed files with 45881 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
// The Flock (a list of Boid objects)
class Flock {
ArrayList boids; // An arraylist for all the boids
Flock() {
boids = new ArrayList(); // Initialize the arraylist
}
void run() {
for (int i = 0; i < boids.size(); i++) {
Boid b = (Boid) boids.get(i);
b.run(boids); // Passing the entire list of boids to each boid individually
}
}
void addBoid(Boid b) {
boids.add(b);
}
}