author | terom |
Thu, 04 Dec 2008 21:59:23 +0000 | |
changeset 200 | 2dbf40661580 |
parent 199 | f5c86420facd |
child 209 | 68cc4248a508 |
permissions | -rw-r--r-- |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
1 |
|
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
2 |
#include "GameState.hh" |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
3 |
#include "Engine.hh" |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
4 |
#include "Config.hh" |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
5 |
|
199 | 6 |
GameState::GameState (void) : local_player(NULL), world(Vector(0, MAP_GRAVITY), Vector(MAP_WIDTH, MAP_HEIGHT)) { } |
7 |
||
8 |
LocalPlayer *GameState::getLocalPlayer (void) { |
|
9 |
return local_player; |
|
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
10 |
} |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
11 |
|
199 | 12 |
void GameState::newLocalPlayer (LocalPlayer *player) { |
13 |
if (local_player) |
|
14 |
throw std::logic_error("newLocalPlayer called even though we already have a local player"); |
|
15 |
||
16 |
player_list.push_back(player); |
|
17 |
||
18 |
local_player = player; |
|
19 |
} |
|
200
2dbf40661580
better NetworkBuffer/Packet stuff + some additional Physics+Network stuff + random fixes
terom
parents:
199
diff
changeset
|
20 |
|
199 | 21 |
void GameState::newRemotePlayer (RemotePlayer *player) { |
22 |
player_list.push_back(player); |
|
23 |
} |
|
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
24 |
|
199 | 25 |
void GameState::removePlayer (Player *player) { |
26 |
player_list.remove(player); |
|
27 |
} |
|
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
28 |
|
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
29 |
|
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
30 |
|
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
31 |