package example7_2.game.characters; import example7_2.game.GameCharacter; import java.awt.Point; import java.util.ArrayList; import java.util.List; public class Swarm extends GameCharacter { List bees = new ArrayList(); public Swarm(String name, String imageFile, String soundFile, behaviorType moveBehavior) { super(name, imageFile, soundFile); //setMoveBehavior(moveBehavior); bees.add(new Bee("Bob","bee-1.jpg",soundFile)); bees.add(new Bee("Nancy",imageFile,soundFile)); } @Override public void setMoveBehavior(behaviorType moveBehaviorType) { super.setMoveBehavior(moveBehaviorType); //To change body of overridden methods use File | Settings | File Templates. } @Override public double distanceTo(GameCharacter otherCharacter) { return bees.get(0).distanceTo(otherCharacter); //To change body of overridden methods use File | Settings | File Templates. } @Override public void planMove(List list) { super.planMove(list); //To change body of overridden methods use File | Settings | File Templates. } @Override public Point getCurrentPosition() { return bees.get(0).getCurrentPosition(); } @Override public void setCurrentPosition(Point currentPos) { bees.get(0).setCurrentPosition(currentPos); //To change body of overridden methods use File | Settings | File Templates. } @Override public void finishMove(List list) { // TODO: Move other bees. bees.get(0).finishMove(list); } }