proto/p2/GameState.hh
author terom
Mon, 03 Nov 2008 21:36:17 +0000
changeset 3 5a209a8585c9
child 4 e28b28b8817c
permissions -rw-r--r--
proto p2
#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