Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions include/FirstStageSubEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
#define FIRSTSTAGESUBENGINE_H

#include <GameStage.h>
#include <Game.h>
#include <Logger.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

рефакторить вдвоём один файл - боль

#include <Game.h>
#include <set>

class FirstStageSubEngine
Expand Down
54 changes: 28 additions & 26 deletions include/GameEngine.h
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
#ifndef GAMEENGINE_H
#define GAMEENGINE_H

#include <Game.h>
#include <GameStage.h>
#define GAMEENGINE_H
#include <Game.h>
#include <GameStage.h>
#include <PreparationEngine.h>
#include <FirstStageSubEngine.h>
#include <SecondStageSubEngine.h>
#include <ThirdStageSubEngine.h>
#include <Logger.h>

class GameEngine
{
GameEngine(const GameEngine &) = delete;
GameEngine &operator= (const GameEngine &) = delete;

//#include "format.h"
//#include "format.cc"

class GameEngine
{
GameEngine(const GameEngine &) = delete;
GameEngine &operator= (const GameEngine &) = delete;

public:
enum {VICTORY_POINTS = 10};
enum {POINTS_PER_TOWN = 1, POINTS_PER_CITY = 2};

GameEngine() {Logger::init_logger();}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

то же самое

~GameEngine();

//PREPARATION STAGE
void join_player(const std::string &);
void unjoin_player(const std::string &);

GameEngine() = default;
~GameEngine();

//PREPARATION STAGE
void join_player(const std::string &);
void unjoin_player(const std::string &);
void start_game();

void register_road(const std::string &player, const std::string &name);
Expand Down Expand Up @@ -81,18 +83,18 @@ class GameEngine
int score(const std::string &player);
GameStage stage() const noexcept {return _game_stage;}

const Player &winner() const;

private:
GameStage _game_stage = GameStage::PLAYERS_REGISTRATION;
const Player &winner() const;
private:
GameStage _game_stage = GameStage::PLAYERS_REGISTRATION;
Game *_game = new Game();
size_t _current_player = 0;

size_t _current_player = 0;
PreparationEngine *_preparation_stage = new PreparationEngine(*_game);
FirstStageSubEngine *_first_stage = nullptr;
SecondStageSubEngine *_second_stage = nullptr;
ThirdStageSubEngine *_third_stage = nullptr;
ThirdStageSubEngine *_third_stage = nullptr;
};

#endif // GAMEENGINE_H

5 changes: 1 addition & 4 deletions include/PreparationEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
#define PREPARATIONENGINE_H

#include <stdexcept>
#include <list>

#include <list>
#include <Game.h>
#include <GameStage.h>
#include <Logger.h>

using std::string;

class PreparationEngine
Expand Down
3 changes: 1 addition & 2 deletions include/SecondStageSubEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

#include <vector>
#include <Game.h>
#include <Exchange.h>
#include <Logger.h>
#include <Exchange.h>

class SecondStageSubEngine
{
Expand Down
3 changes: 1 addition & 2 deletions include/ThirdStageSubEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
#define THIRDSTAGESUBENGINE_H

#include <Field.h>
#include <Player.h>
#include <Logger.h>
#include <Player.h>
#include <set>

class ThirdStageSubEngine
Expand Down
Loading