From: Hendrik B. <nh...@us...> - 2006-08-30 20:36:02
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/entity In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv30984/src/games/stendhal/server/entity Modified Files: PersonalChest.java Log Message: use TurnNotifier/TurnListener instead of Script Index: PersonalChest.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/PersonalChest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PersonalChest.java 25 Aug 2006 00:59:59 -0000 1.11 --- PersonalChest.java 30 Aug 2006 20:35:55 -0000 1.12 *************** *** 1,11 **** package games.stendhal.server.entity; - import marauroa.common.game.*; import games.stendhal.server.StendhalRPWorld; ! import games.stendhal.server.scripting.ScriptAction; ! import games.stendhal.server.StendhalScriptSystem; import java.util.LinkedList; import java.util.List; /** * A PersonalChest is a Chest that can be used by everyone, but shows --- 1,16 ---- package games.stendhal.server.entity; import games.stendhal.server.StendhalRPWorld; ! import games.stendhal.server.events.TurnListener; ! import games.stendhal.server.events.TurnNotifier; ! import java.util.LinkedList; import java.util.List; + import marauroa.common.game.AttributeNotFoundException; + import marauroa.common.game.IRPZone; + import marauroa.common.game.RPObject; + import marauroa.common.game.RPSlot; + /** * A PersonalChest is a Chest that can be used by everyone, but shows *************** *** 35,44 **** attending = null; ! /** Add a script to copy automatically. */ ! StendhalScriptSystem scripts = StendhalScriptSystem.get(); ! scripts.addScript(null, new ScriptAction() { ! @Override ! public void fire() { if (attending != null) { /* Can be replaced when we add Equip event */ --- 40,47 ---- attending = null; + + TurnListener turnListener = new TurnListener() { ! public void onTurnReached(int currentTurn, String message) { if (attending != null) { /* Can be replaced when we add Equip event */ *************** *** 87,92 **** } } } ! }); } --- 90,97 ---- } } + TurnNotifier.get().notifyInTurns(0, this, null); } ! }; ! TurnNotifier.get().notifyInTurns(0, turnListener, null); } |