Terminus
gameendedcommand.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace terminus
6 {
7 
14 {
15 public:
17  GameEndedCommand(Timer::TimerMSec timeStamp, QJsonObject jsonObject);
18 
19  virtual QJsonObject toJson() const override;
20  virtual void doWork() override;
21 
22  virtual Commands commandType() const override { return Commands::Command_GameEnded; }
23 
24  bool youWin() const { return m_youWin; }
25 
26 protected:
27  bool m_youWin;
28 };
29 
30 } // namespace terminus
GameEndedCommand(Timer::TimerMSec timeStamp, bool youWin)
Definition: gameendedcommand.cpp:8
The GameEndedCommand signals that the remote game detected a winning or losing condition. It will display a victory or defeat screen accordingly.
Definition: gameendedcommand.h:13
Definition: commands.h:16
virtual QJsonObject toJson() const override
Every command must define how its members can be serialized.
Definition: gameendedcommand.cpp:21
bool youWin() const
Definition: gameendedcommand.h:24
bool m_youWin
Definition: gameendedcommand.h:27
Commands
The Commands enum stores all command types with corresponding ID.
Definition: commands.h:9
virtual void doWork() override
Every Commands must define its effects on the receiving game.
Definition: gameendedcommand.cpp:27
signed int TimerMSec
Definition: timer.h:22
Definition: eventhandler.cpp:18
Timer::TimerMSec timeStamp() const
get the time as counted by the sending game that this command was created and sent ...
Definition: abstractcommand.cpp:54
virtual Commands commandType() const override
Every Command must specify its type.
Definition: gameendedcommand.h:22
The AbstractCommand class defines the interface that every command has to implement.
Definition: abstractcommand.h:23