--- a/src/proto2/GameState.hh Tue Nov 18 18:34:33 2008 +0000
+++ b/src/proto2/GameState.hh Tue Nov 18 18:50:32 2008 +0000
@@ -1,38 +1,35 @@
#ifndef GAMESTATE_HH
#define GAMESTATE_HH
-#include "Dimension.hh"
+#include "Physics.hh"
+#include "Input.hh"
#include <list>
#include <stdexcept>
-enum PlayerType {
- PLAYER_LOCAL,
- PLAYER_REMOTE
-};
-
-#define PLAYER_DIM_W 10
-#define PLAYER_DIM_H 10
-#define MAP_DIM_W 800
-#define MAP_DIM_H 640
+const uint16_t PLAYER_MASS = 8035;
+const uint16_t PLAYER_DIM_W = 10;
+const uint16_t PLAYER_DIM_H = 10;
+const uint16_t MAP_DIM_W = 800;
+const uint16_t MAP_DIM_H = 640;
// forward-declare GameState
class GameState;
class Player : public PhysicsObject {
+ protected:
+
public:
- Player(GameState &state, Coordinate c, bool visible) :
- PhysicsObject(...), dimensions(PLAYER_DIM_W, PLAYER_DIM_H), visible(visible) { }
+ Player(Vector position, bool visible) :
+ PhysicsObject(PLAYER_MASS, position, Vector(0, 0), Vector(0, 0)), visible(visible) { }
- PlayerType type;
- Dimension dimensions;
bool visible;
};
class LocalPlayer : public Player {
protected:
- LocalPlayer (Coordinate c, bool visible) : Player(c, visible) { }
+ LocalPlayer (Vector pos, bool visible) : Player(pos, visible) { }
public:
virtual bool handleMove (PlayerInput_Move input);
@@ -40,7 +37,7 @@
class RemotePlayer : public Player {
protected:
- RemotePlayer (Coordinate c, bool visible) : Player(c, visible) { }
+ RemotePlayer (Vector pos, bool visible) : Player(pos, visible) { }
};
class GameState : public PhysicsWorld {
@@ -50,7 +47,7 @@
// only one local player is supported
LocalPlayer *local_player;
- GameState (void) : PhysicsWorld(...), local_player(NULL) {
+ GameState (void) : PhysicsWorld(Vector(MAP_DIM_W, MAP_DIM_H)), local_player(NULL) {
}