#include <vector>
#include <hotseatgame/unitsqueue.h>
#include <playermanager.h>


class Cell;

class GameManager : public QObject
{
private:
    std::vector< std::vector< Cell* > > game_table_;
    int col_table_size_, row_table_size_;
    void generateTable();
    /******************************/
    UnitsQueue turn_queue_;
    PlayerManager* player_manager_;
    int cur_player_id_;

public:
    void buildGameTable(int, int);
    static GameManager& getInstance() {
        static GameManager instance;
        return instance;
    }
    UnitsQueue* getTurnQueue();

    void AddToUnitQueue(Unit* unit);

    void RmFromUnitQueue(Unit* unit);

    Player* getCurrentPlayer();

    int getCurPlayerId();

private:
     explicit GameManager(QObject *parent = nullptr);
};
