// Helene Martin, CSE 142 // Cougars go west then east between pieces of food. They // are blue until they fight then are red. They are displayed // as the letter "C", always eat and always pounce when fighting. import java.awt.*; public class Cougar extends Critter { private boolean goingWest; private boolean hasFought; public Cougar() { goingWest = true; hasFought = false; } public Direction getMove() { if (goingWest) { return Direction.WEST; } else { return Direction.EAST; } } public String toString() { return "C"; } public boolean eat() { goingWest = !goingWest; return true; } public Attack fight(String opponent) { hasFought = true; return Attack.POUNCE; } public Color getColor() { if (hasFought) { return Color.RED; } else { return Color.BLUE; } } }