mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 14:32:15 -07:00
Differentiate games and replays.
Took 9 seconds
This commit is contained in:
parent
0e33187388
commit
595eb609ad
29 changed files with 224 additions and 177 deletions
68
cockatrice/src/game/abstract_game.h
Normal file
68
cockatrice/src/game/abstract_game.h
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
#ifndef COCKATRICE_ABSTRACT_GAME_H
|
||||
#define COCKATRICE_ABSTRACT_GAME_H
|
||||
|
||||
#include "../../../common/pb/game_replay.pb.h"
|
||||
#include "game_event_handler.h"
|
||||
#include "game_meta_info.h"
|
||||
#include "game_state.h"
|
||||
#include "player/player_manager.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class CardItem;
|
||||
class TabGame;
|
||||
class AbstractGame : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit AbstractGame(TabGame *tab);
|
||||
|
||||
TabGame *tab;
|
||||
GameMetaInfo *gameMetaInfo;
|
||||
GameState *gameState;
|
||||
GameEventHandler *gameEventHandler;
|
||||
PlayerManager *playerManager;
|
||||
CardItem *activeCard;
|
||||
|
||||
TabGame *getTab() const
|
||||
{
|
||||
return tab;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
CardItem *getCard(int playerId, const QString &zoneName, int cardId) const;
|
||||
|
||||
void setActiveCard(CardItem *card);
|
||||
CardItem *getActiveCard() const
|
||||
{
|
||||
return activeCard;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // COCKATRICE_ABSTRACT_GAME_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue