Index: common/Game.cpp
===================================================================
--- common/Game.cpp	(revision 53643cad0b21a051f5301ad161c43380ff3b29d8)
+++ common/Game.cpp	(revision 5037b4bca181883e704bbd8c4fb7af7825e3536f)
@@ -235,223 +235,4 @@
 }
 
-bool Game::handleGameEvents() {
-   map<unsigned int, Player*>::iterator it;
-   bool gameFinished = false;
-
-   for (it = this->getPlayers().begin(); it != this->getPlayers().end(); it++) {
-      gameFinished = gameFinished || this->handlePlayerEvents(it->second);
-   }
-
-   if (gameFinished) {
-      for (it = this->players.begin(); it != this->players.end(); it++) {
-         it->second->currentGame = NULL;
-      }
-   }
-
-   return gameFinished;
-}
-
-bool Game::handlePlayerEvents(Player* p) {
-   NETWORK_MSG serverMsg;
-   FLOAT_POSITION oldPos;
-   bool gameFinished = false;
-   bool broadcastMove = false;
-
-   cout << "moving player" << endl;
-
-   // move player and perform associated tasks
-   oldPos = p->pos;
-   if (p->move(this->worldMap)) {
-
-      cout << "player moved" << endl;
-      if (this->processPlayerMovement(p, oldPos))
-         broadcastMove = true;
-      cout << "player move processed" << endl;
-
-      ObjectType flagType;
-      POSITION pos;
-      bool flagTurnedIn = false;
-      bool flagReturned = false;
-      bool ownFlagAtBase = false;
-
-      switch(this->worldMap->getStructure(p->pos.x/25, p->pos.y/25)) {
-         case STRUCTURE_BLUE_FLAG:
-         {
-            if (p->team == 0 && p->hasRedFlag) {
-               // check that your flag is at your base
-               pos = this->worldMap->getStructureLocation(STRUCTURE_BLUE_FLAG);
-                           
-               vector<WorldMap::Object>* vctObjects = this->worldMap->getObjects();
-               vector<WorldMap::Object>::iterator itObjects;
-
-               for (itObjects = vctObjects->begin(); itObjects != vctObjects->end(); itObjects++) {
-                  if (itObjects->type == OBJECT_BLUE_FLAG) {
-                     if (itObjects->pos.x == pos.x*25+12 && itObjects->pos.y == pos.y*25+12) {
-                        ownFlagAtBase = true;
-                        break;
-                     }
-                  }
-               }
-
-               if (ownFlagAtBase) {
-                  p->hasRedFlag = false;
-                  flagType = OBJECT_RED_FLAG;
-                  pos = this->worldMap->getStructureLocation(STRUCTURE_RED_FLAG);
-                  flagTurnedIn = true;
-                  this->blueScore++;
-               }
-            }
-
-            break;
-         }
-         case STRUCTURE_RED_FLAG:
-         {
-            if (p->team == 1 && p->hasBlueFlag) {
-               // check that your flag is at your base
-               pos = this->worldMap->getStructureLocation(STRUCTURE_RED_FLAG);
-                        
-               vector<WorldMap::Object>* vctObjects = this->worldMap->getObjects();
-               vector<WorldMap::Object>::iterator itObjects;
-
-               for (itObjects = vctObjects->begin(); itObjects != vctObjects->end(); itObjects++) {
-                  if (itObjects->type == OBJECT_RED_FLAG) {
-                     if (itObjects->pos.x == pos.x*25+12 && itObjects->pos.y == pos.y*25+12) {
-                        ownFlagAtBase = true;
-                        break;
-                     }
-                  }
-               }
-
-               if (ownFlagAtBase) {
-                  p->hasBlueFlag = false;
-                  flagType = OBJECT_BLUE_FLAG;
-                  pos = this->worldMap->getStructureLocation(STRUCTURE_BLUE_FLAG);
-                  flagTurnedIn = true;
-                  this->redScore++;
-               }
-            }
-
-            break;
-         }
-         default:
-         {
-            break;
-         }
-      }
-
-      if (flagTurnedIn) {
-         unsigned int blueScore = this->blueScore;
-         unsigned int redScore = this->redScore;
-
-         pos.x = pos.x*25+12;
-         pos.y = pos.y*25+12;
-         this->addObjectToMap(flagType, pos.x, pos.y);
-
-         serverMsg.type = MSG_TYPE_SCORE;
-         memcpy(serverMsg.buffer, &blueScore, 4);
-         memcpy(serverMsg.buffer+4, &redScore, 4);
-         msgProcessor->broadcastMessage(serverMsg, this->players);
-
-         // check to see if the game should end
-         // move to its own method
-         if (this->blueScore == 3 || this->redScore == 3) {
-            gameFinished = true;
-
-            unsigned int winningTeam;
-            if (this->blueScore == 3)
-               winningTeam = 0;
-            else if (this->redScore == 3)
-               winningTeam = 1;
-
-            serverMsg.type = MSG_TYPE_FINISH_GAME;
-
-            // I should create an instance of the GameSummary object here and just serialize it into this message
-            memcpy(serverMsg.buffer, &winningTeam, 4);
-            memcpy(serverMsg.buffer+4, &blueScore, 4);
-            memcpy(serverMsg.buffer+8, &redScore, 4);
-            strcpy(serverMsg.buffer+12, this->getName().c_str());
-            msgProcessor->broadcastMessage(serverMsg, this->players);
-         }
-
-         // this means a PLAYER message will be sent
-         broadcastMove = true;
-      }
-
-      // go through all objects and check if the player is close to one and if its their flag
-      vector<WorldMap::Object>* vctObjects = this->worldMap->getObjects();
-      vector<WorldMap::Object>::iterator itObjects;
-      POSITION structPos;
-
-      for (itObjects = vctObjects->begin(); itObjects != vctObjects->end(); itObjects++) {
-         POSITION pos = itObjects->pos;
-
-         if (posDistance(p->pos, pos.toFloat()) < 10) {
-            if (p->team == 0 && itObjects->type == OBJECT_BLUE_FLAG) {
-               structPos = this->worldMap->getStructureLocation(STRUCTURE_BLUE_FLAG);
-               flagReturned = true;
-               break;
-            } else if (p->team == 1 && itObjects->type == OBJECT_RED_FLAG) {
-               structPos = this->worldMap->getStructureLocation(STRUCTURE_RED_FLAG);
-               flagReturned = true;
-               break;
-            }
-         }
-      }
-
-      if (flagReturned) {
-         itObjects->pos.x = structPos.x*25+12;
-         itObjects->pos.y = structPos.y*25+12;
-
-         serverMsg.type = MSG_TYPE_OBJECT;
-         itObjects->serialize(serverMsg.buffer);
-         msgProcessor->broadcastMessage(serverMsg, this->players);
-      }
-
-      if (broadcastMove) {
-         serverMsg.type = MSG_TYPE_PLAYER;
-         p->serialize(serverMsg.buffer);
-         msgProcessor->broadcastMessage(serverMsg, this->players);
-      }
-   }
-
-   cout << "processing player attack" << endl;
-
-   // check if the player's attack animation is complete
-   if (p->isAttacking && p->timeAttackStarted+p->attackCooldown <= getCurrentMillis()) {
-      p->isAttacking = false;
-      cout << "Attack animation is complete" << endl;
-
-      //send everyone an ATTACK message
-      cout << "about to broadcast attack" << endl;
-
-      if (p->attackType == Player::ATTACK_MELEE) {
-         cout << "Melee attack" << endl;
-
-         Player* target = players[p->getTargetPlayer()];
-         this->dealDamageToPlayer(target, p->damage);
-      } else if (p->attackType == Player::ATTACK_RANGED) {
-         cout << "Ranged attack" << endl;
-
-         Projectile proj(p->pos.x, p->pos.y, p->getTargetPlayer(), p->damage);
-         this->assignProjectileId(&proj);
-         this->addProjectile(proj);
-
-         int x = p->pos.x;
-         int y = p->pos.y;
-         unsigned int targetId = p->getTargetPlayer();
-
-         serverMsg.type = MSG_TYPE_PROJECTILE;
-         memcpy(serverMsg.buffer, &proj.id, 4);
-         memcpy(serverMsg.buffer+4, &x, 4);
-         memcpy(serverMsg.buffer+8, &y, 4);
-         memcpy(serverMsg.buffer+12, &targetId, 4);
-         msgProcessor->broadcastMessage(serverMsg, players);
-      } else
-         cout << "Invalid attack type: " << p->attackType << endl;
-   }
-
-   return gameFinished;
-}
-
 void Game::assignProjectileId(Projectile* p) {
    p->id = unusedProjectileId;
Index: common/Game.h
===================================================================
--- common/Game.h	(revision 53643cad0b21a051f5301ad161c43380ff3b29d8)
+++ common/Game.h	(revision 5037b4bca181883e704bbd8c4fb7af7825e3536f)
@@ -61,7 +61,4 @@
    void dealDamageToPlayer(Player* p, int damage);
 
-   bool handleGameEvents();
-   bool handlePlayerEvents(Player* p);
-
    void assignProjectileId(Projectile* p);
    void updateUnusedProjectileId();
