public void reset() { LinkedListNode walker = goals.getRoot(); while (walker != null) { Goal goal = (Goal) walker.object; goal.reset(); walker = walker.Next; } }
public int checkGoals() { LinkedListNode walker = goals.getRoot(); int status = Goal.ALIVE; // go through goal list to check status of each goal if (GameInfo.player.isDead()) return status; while (walker != null) { Goal goal = (Goal) walker.object; int thisStatus = goal.checkGoal(); // give player benefit of doubt if (thisStatus == Goal.WIN) return Goal.WIN; else if (thisStatus == Goal.LOSE) status = Goal.LOSE; walker = walker.Next; } return status; }