proto/p2/GameState.hh
changeset 3 5a209a8585c9
child 4 e28b28b8817c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/proto/p2/GameState.hh	Mon Nov 03 21:36:17 2008 +0000
@@ -0,0 +1,48 @@
+#ifndef GAMESTATE_HH
+#define GAMESTATE_HH
+
+class GameState {
+	public:
+		Dimension map_dimensions;
+		std::list<Player> player_list;
+
+		LocalPlayer &getLocalPlayer (void) {
+			// XXX: jotain
+		}
+};
+
+enum PlayerType {
+	PLAYER_LOCAL = 0x01;
+	PLAYER_REMOTE = 0x02;
+};
+
+class Player {
+	private:
+		Coordinate position;
+
+	public:
+		PlayerType type;
+		Dimensions dimensions;
+
+		Coordinate getPosition (void) {
+			return this->position;
+		}
+};
+
+class LocalPlayer : public Player {
+	public:
+		void doMovement (PositionDelta d) {
+			this->position += d;
+
+			// XXX: notify server
+		}
+};
+
+class RemotePlayer : public Player {
+	public:
+		void updatePosition (Position p) {
+			this->position = p;
+		}
+}
+
+#endif