From 750b58b3b7fad5ec068d43e39d74d55eb52e5058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20=C3=98rbekk?= Date: Thu, 23 Feb 2012 13:51:02 +0100 Subject: Remove com.orbekk.same.Same. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit – Remove references from GameController. (GameController is now perfectly broken and should be refactored to using Variables) --- .../main/java/com/orbekk/same/GameController.java | 30 ++++++++-------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'same-android/src') diff --git a/same-android/src/main/java/com/orbekk/same/GameController.java b/same-android/src/main/java/com/orbekk/same/GameController.java index 144d6af..b8ea7ad 100644 --- a/same-android/src/main/java/com/orbekk/same/GameController.java +++ b/same-android/src/main/java/com/orbekk/same/GameController.java @@ -6,18 +6,17 @@ import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.orbekk.same.SameInterface; import com.orbekk.same.StateChangedListener; import com.orbekk.same.UpdateConflict; import android.graphics.Paint; -public class GameController implements StateChangedListener { +public class GameController { private Logger logger = LoggerFactory.getLogger(getClass()); private List remotePlayers = new ArrayList(); private Player localPlayer; private ChangeListener changeListener = null; - private SameInterface same; +// private SameInterface same; public static class Player { public Paint color; @@ -38,27 +37,20 @@ public class GameController implements StateChangedListener { return player; } - public static GameController create(Player localPlayer, - SameInterface same) { - GameController controller = new GameController(localPlayer, same); - same.addStateChangedListener(controller); + public static GameController create(Player localPlayer) { + GameController controller = new GameController(localPlayer); +// same.addStateChangedListener(controller); return controller; } - GameController(Player localPlayer, SameInterface same) { + GameController(Player localPlayer) { this.localPlayer = localPlayer; - this.same = same; } - public void setMyPosition(float x, float y) { + public void setMyPosition(float x, float y) throws UpdateConflict { this.localPlayer.posX = x; this.localPlayer.posY = y; changeListener.playerStatesChanged(); - try { - same.set("position", x + "," + y); - } catch (UpdateConflict e) { - logger.warn("Update failed.", e); - } } public Player getLocalPlayer() { @@ -73,8 +65,8 @@ public class GameController implements StateChangedListener { this.changeListener = listener; } - @Override - public void stateChanged(String id, String data) { - logger.info("StateChanged({}, {})", id, data); - } +// @Override +// public void stateChanged(String id, String data) { +// logger.info("StateChanged({}, {})", id, data); +// } } -- cgit v1.2.3