// Helene Martin, CSE 142 // Cougars are represented by a C, change color on whether they have fought and always move // back and forth between food. // Your Critters should have a comment on each method! import java.awt.*; // for Color public class Cougar extends Critter { private boolean hasFought; private boolean goingWest; public Cougar() { hasFought = false; } public Attack fight(String opponent) { hasFought = true; return Attack.POUNCE; } public boolean eat() { goingWest = !goingWest; // change direction return true; } public Direction getMove() { if (goingWest) { return Direction.WEST; } else { return Direction.EAST; } } public String toString() { return "C"; } public Color getColor() { if (hasFought) { return Color.RED; } else { return Color.BLUE; } } }