package example7_2.game.characters; import java.util.List; import example7_2.game.GameCharacter; import example7_2.game.MoveBehavior; /** * This class represents a Flower. Flower extends GameCharacter, which contains a GameCharacterImage, and * thus it can paint itself in a window. * @author hornick */ public class Flower extends GameCharacter { /** * ctor - creates an instance of a Flower * @param name the name of the Flower * @param imageFile image to display */ private Flower(String name, String imageFile ) { super( name, imageFile, null ); // make the abstract GameCharacter ctor do the work... } /** * This method is called by the Game framework at the end of every move to give the GameCharacter * the chance to take some action. * @param list a list of GameCharacter in the same board cell as this GameCharacter */ @Override public void finishMove(List list) { // hmm. What if nightshade was poisonous? } public static Flower createFlower(String name, String imageName) { Flower flower = new Flower(name, imageName); flower.setMoveBehavior(MoveBehavior.behaviorType.NONE); return flower; } }