diff options
author | Justin Worthe <justin.worthe@gmail.com> | 2015-06-06 17:16:44 +0200 |
---|---|---|
committer | Justin Worthe <justin.worthe@gmail.com> | 2015-06-06 17:16:44 +0200 |
commit | 720edc0849aa69e1c944ac7a32ebcbe2ff1e4bf0 (patch) | |
tree | 577b1cc3455c7e5a25506f9194f9e6b7132e3839 | |
parent | c85ebd55fe327125fd4d53d3b62d2b4f145a07a5 (diff) |
Fixed indentation to be all spaces
-rw-r--r-- | include/move.h | 8 | ||||
-rw-r--r-- | src/game_state.cpp | 70 |
2 files changed, 38 insertions, 40 deletions
diff --git a/include/move.h b/include/move.h index e0e9b6b..8f27977 100644 --- a/include/move.h +++ b/include/move.h @@ -1,7 +1,7 @@ -#ifndef MOVE_H -#define MOVE_H +#pragma once -enum class Move: int { +enum class Move: int +{ NOTHING = 0, MOVE_LEFT = 1, MOVE_RIGHT = 2, @@ -10,5 +10,3 @@ enum class Move: int { BUILD_MISSILE_CONTROLLER = 5, BUILD_SHIELD = 6 }; - -#endif diff --git a/src/game_state.cpp b/src/game_state.cpp index 861471b..e8151e3 100644 --- a/src/game_state.cpp +++ b/src/game_state.cpp @@ -19,37 +19,37 @@ GameState::GameState(std::string mapFilename) for (int x=-1; y <= GAME_AREA_LINES; ++x) { char nextChar = mapFile.get(); - if (nextChar == EOF) - { - break; - } + if (nextChar == EOF) + { + break; + } - switch (nextChar) - { - case Alien::MAP_CHAR: - aliens.push_back(Alien(x,y)); - break; - case EnemyBullet::ALIEN_MAP_CHAR: - case EnemyBullet::ENEMY_MISSILE_MAP_CHAR: - bullets.push_back(EnemyBullet(x,y)); - break; - case PlayerMissile::MAP_CHAR: - missiles.push_back(PlayerMissile(x,y)); - break; - case Shield::MAP_CHAR: - shields.push_back(Shield(x,y)); - break; - case Spaceship::ENEMY_MAP_CHAR: - case Spaceship::PLAYER_MAP_CHAR: - spaceships.push_back(Spaceship(x+1,y)); - x += 2; - mapFile.ignore(2); - break; - case '\n': - ++y; - x = -1; - break; - } + switch (nextChar) + { + case Alien::MAP_CHAR: + aliens.push_back(Alien(x,y)); + break; + case EnemyBullet::ALIEN_MAP_CHAR: + case EnemyBullet::ENEMY_MISSILE_MAP_CHAR: + bullets.push_back(EnemyBullet(x,y)); + break; + case PlayerMissile::MAP_CHAR: + missiles.push_back(PlayerMissile(x,y)); + break; + case Shield::MAP_CHAR: + shields.push_back(Shield(x,y)); + break; + case Spaceship::ENEMY_MAP_CHAR: + case Spaceship::PLAYER_MAP_CHAR: + spaceships.push_back(Spaceship(x+1,y)); + x += 2; + mapFile.ignore(2); + break; + case '\n': + ++y; + x = -1; + break; + } } } @@ -57,22 +57,22 @@ void GameState::logState() { for (auto alien : aliens) { - std::cout << "Alien " << alien.coords() << std::endl; + std::cout << "Alien " << alien.coords() << std::endl; } for (auto bullet : bullets) { - std::cout << "Enemy Bullet" << bullet.coords() << std::endl; + std::cout << "Enemy Bullet" << bullet.coords() << std::endl; } for (auto missile : missiles) { - std::cout << "Player Missile" << missile.coords() << std::endl; + std::cout << "Player Missile" << missile.coords() << std::endl; } for (auto shield : shields) { - std::cout << "Shield" << shield.coords() << std::endl; + std::cout << "Shield" << shield.coords() << std::endl; } for (auto spaceship : spaceships) { - std::cout << "Spaceship" << spaceship.coords() << std::endl; + std::cout << "Spaceship" << spaceship.coords() << std::endl; } } |