/** Generate a notification that the {@link Maze} has changed in some fashion. */ private void update() { Iterator i = listenerSet.iterator(); while (i.hasNext()) { Object o = i.next(); assert (o instanceof MazeListener); MazeListener ml = (MazeListener) o; ml.mazeUpdate(); } }
/** * Generate a notification to listeners that a {@link Client} has fired. * * @param c The {@link Client} that fired. */ private void notifyClientFired(Client c) { assert (c != null); Iterator i = listenerSet.iterator(); while (i.hasNext()) { Object o = i.next(); assert (o instanceof MazeListener); MazeListener ml = (MazeListener) o; ml.clientFired(c); } }
/** * Generate a notification to listeners that a {@link Client} has been killed. * * @param source The {@link Client} that fired the projectile. * @param target The {@link Client} that was killed. */ private void notifyClientKilled(Client source, Client target) { assert (source != null); assert (target != null); Iterator i = listenerSet.iterator(); while (i.hasNext()) { Object o = i.next(); assert (o instanceof MazeListener); MazeListener ml = (MazeListener) o; ml.clientKilled(source, target); } }