Drawer lis?tty. Pari metodia gamestateen ja dimensioniin.
#ifndef GAMESTATE_HH
#define GAMESTATE_HH
#include "Dimension.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:
Player(Coordinate c) : position(c) {}
PlayerType type;
Dimensions dimensions;
Coordinate getPosition (void) const {
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