mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 16:13:54 -07:00
Took 3 hours 38 minutes Took 11 seconds Took 9 minutes Took 2 minutes Took 22 minutes Took 43 minutes Took 4 minutes Took 31 minutes Took 7 seconds Took 1 minute [Game][Player] Pull out graphics_items out of player_logic Took 3 minutes Took 24 seconds Took 5 minutes Took 19 minutes Took 7 minutes Took 32 seconds Took 3 minutes Took 14 minutes Took 5 seconds Took 28 minutes Took 5 minutes Took 28 minutes Took 7 seconds Took 12 minutes Took 20 minutes Took 2 minutes
68 lines
1.3 KiB
C++
68 lines
1.3 KiB
C++
/**
|
|
* @file abstract_game.h
|
|
* @ingroup GameLogic
|
|
*/
|
|
//! \todo Document this file.
|
|
|
|
#ifndef COCKATRICE_ABSTRACT_GAME_H
|
|
#define COCKATRICE_ABSTRACT_GAME_H
|
|
|
|
#include "board/card_state.h"
|
|
#include "game_event_handler.h"
|
|
#include "game_meta_info.h"
|
|
#include "game_state.h"
|
|
#include "player/player_manager.h"
|
|
|
|
#include <QObject>
|
|
#include <libcockatrice/protocol/pb/game_replay.pb.h>
|
|
|
|
class CardItem;
|
|
class AbstractGame : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit AbstractGame(QObject *parent);
|
|
|
|
GameMetaInfo *gameMetaInfo;
|
|
GameState *gameState;
|
|
GameEventHandler *gameEventHandler;
|
|
PlayerManager *playerManager;
|
|
CardItem *activeCard;
|
|
|
|
GameMetaInfo *getGameMetaInfo()
|
|
{
|
|
return gameMetaInfo;
|
|
}
|
|
|
|
GameState *getGameState() const
|
|
{
|
|
return gameState;
|
|
}
|
|
|
|
GameEventHandler *getGameEventHandler() const
|
|
{
|
|
return gameEventHandler;
|
|
}
|
|
|
|
PlayerManager *getPlayerManager() const
|
|
{
|
|
return playerManager;
|
|
}
|
|
|
|
bool isHost() const;
|
|
|
|
AbstractClient *getClientForPlayer(int playerId) const;
|
|
|
|
void loadReplay(GameReplay *replay);
|
|
|
|
CardState *getCard(int playerId, const QString &zoneName, int cardId) const;
|
|
|
|
void setActiveCard(CardItem *card);
|
|
CardItem *getActiveCard() const
|
|
{
|
|
return activeCard;
|
|
}
|
|
};
|
|
|
|
#endif // COCKATRICE_ABSTRACT_GAME_H
|