From: Daniel H. <wik...@us...> - 2006-08-09 21:29:24
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv9276/src/games/stendhal/server Modified Files: TurnNotifier.java RespawnPoint.java Log Message: renamed TurnEvent to TurnListener Index: TurnNotifier.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/TurnNotifier.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TurnNotifier.java 7 Aug 2006 20:48:53 -0000 1.7 --- TurnNotifier.java 9 Aug 2006 21:29:18 -0000 1.8 *************** *** 1,5 **** package games.stendhal.server; ! import games.stendhal.server.events.TurnEvent; import java.util.HashMap; --- 1,5 ---- package games.stendhal.server; ! import games.stendhal.server.events.TurnListener; import java.util.HashMap; *************** *** 28,32 **** * Turns at which no event should take place needn't be registered here. */ ! private Map<Integer, Set<TurnEvent>> register = new HashMap<Integer, Set<TurnEvent>>(); /** Used for multi-threading synchronization. **/ --- 28,32 ---- * Turns at which no event should take place needn't be registered here. */ ! private Map<Integer, Set<TurnListener>> register = new HashMap<Integer, Set<TurnListener>>(); /** Used for multi-threading synchronization. **/ *************** *** 63,67 **** // get and remove the set for this turn ! Set<TurnEvent> set = null; synchronized (sync) { set = register.remove(new Integer(currentTurn)); --- 63,67 ---- // get and remove the set for this turn ! Set<TurnListener> set = null; synchronized (sync) { set = register.remove(new Integer(currentTurn)); *************** *** 69,73 **** if (set != null) { ! for (TurnEvent turnEvent : set) { turnEvent.onTurnReached(currentTurn); } --- 69,73 ---- if (set != null) { ! for (TurnListener turnEvent : set) { turnEvent.onTurnReached(currentTurn); } *************** *** 90,94 **** * @param turnEvent the class to notify */ ! public void notifyInTurns(int diff, TurnEvent turnEvent) { notifyAtTurn(currentTurn + diff + 1, turnEvent); } --- 90,94 ---- * @param turnEvent the class to notify */ ! public void notifyInTurns(int diff, TurnListener turnEvent) { notifyAtTurn(currentTurn + diff + 1, turnEvent); } *************** *** 100,104 **** * @param turnEvent the class to notify */ ! public void notifyAtTurn(int turn, TurnEvent turnEvent) { if (turn <= currentTurn) { logger.error("requested turn " + turn + " is in the past. Current turn is " + currentTurn, new Throwable()); --- 100,104 ---- * @param turnEvent the class to notify */ ! public void notifyAtTurn(int turn, TurnListener turnEvent) { if (turn <= currentTurn) { logger.error("requested turn " + turn + " is in the past. Current turn is " + currentTurn, new Throwable()); *************** *** 108,114 **** // do we have other events for this turn? Integer turnInt = new Integer(turn); ! Set<TurnEvent> set = register.get(turnInt); if (set == null) { ! set = new HashSet<TurnEvent>(); register.put(turnInt, set); } --- 108,114 ---- // do we have other events for this turn? Integer turnInt = new Integer(turn); ! Set<TurnListener> set = register.get(turnInt); if (set == null) { ! set = new HashSet<TurnListener>(); register.put(turnInt, set); } Index: RespawnPoint.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/RespawnPoint.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** RespawnPoint.java 30 Jul 2006 20:03:40 -0000 1.39 --- RespawnPoint.java 9 Aug 2006 21:29:18 -0000 1.40 *************** *** 15,19 **** import games.stendhal.common.Rand; import games.stendhal.server.entity.creature.Creature; ! import games.stendhal.server.events.TurnEvent; import java.util.LinkedList; --- 15,19 ---- import games.stendhal.common.Rand; import games.stendhal.server.entity.creature.Creature; ! import games.stendhal.server.events.TurnListener; import java.util.LinkedList; *************** *** 24,28 **** import org.apache.log4j.Logger; ! public class RespawnPoint implements TurnEvent { private static final int TURNSTORESPAWN = 90; --- 24,28 ---- import org.apache.log4j.Logger; ! public class RespawnPoint implements TurnListener { private static final int TURNSTORESPAWN = 90; |