src/GameState.cc
changeset 222 293ddf4c067d
parent 209 68cc4248a508
child 225 22ecb9cb9245
--- a/src/GameState.cc	Sat Dec 06 16:17:05 2008 +0000
+++ b/src/GameState.cc	Sat Dec 06 17:51:19 2008 +0000
@@ -5,6 +5,10 @@
 
 GameState::GameState (void) : local_player(NULL), world(Vector(0, MAP_GRAVITY), Vector(MAP_WIDTH, MAP_HEIGHT)) { }
 
+void GameState::addProjectile (Projectile *projectile) {
+    projectiles.push_back(projectile);
+}
+
 LocalPlayer *GameState::getLocalPlayer (void) {
     return local_player;
 }
@@ -25,7 +29,18 @@
 void GameState::removePlayer (Player *player) { 
     player_list.remove(player);
 }
-
+    
+void GameState::draw(CL_GraphicContext *gc) {
+    // Draw world/terrain
+    world.draw(gc);
 
-
-
+    // Draw players
+    for (std::list<Player*>::iterator it = player_list.begin(); it != player_list.end(); it++) {
+        (*it)->draw(gc);
+    }
+    // Draw projectiles
+    for (std::list<Projectile*>::iterator it = projectiles.begin(); it != projectiles.end(); it++) {
+        (*it)->draw(gc);
+    }
+}
+