Terminus
pausecommand.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace terminus
6 {
7 
13 {
14 public:
16  PauseCommand(Timer::TimerMSec timeStamp, QJsonObject jsonObject);
17 
18  virtual QJsonObject toJson() const override;
19  virtual void doWork() override;
20 
21  virtual Commands commandType() const override { return Commands::Command_Pause; }
22 
23  bool pause() const { return m_pause; }
24 protected:
25 
26  bool m_pause;
27 };
28 
29 } // namespace terminus
virtual Commands commandType() const override
Every Command must specify its type.
Definition: pausecommand.h:21
PauseCommand(Timer::TimerMSec timeStamp, bool pause)
Definition: pausecommand.cpp:9
bool m_pause
Definition: pausecommand.h:26
virtual void doWork() override
Every Commands must define its effects on the receiving game.
Definition: pausecommand.cpp:29
bool pause() const
Definition: pausecommand.h:23
Commands
The Commands enum stores all command types with corresponding ID.
Definition: commands.h:9
signed int TimerMSec
Definition: timer.h:22
virtual QJsonObject toJson() const override
Every command must define how its members can be serialized.
Definition: pausecommand.cpp: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
Definition: commands.h:10
The AbstractCommand class defines the interface that every command has to implement.
Definition: abstractcommand.h:23
The PauseCommand pauses or unpauses the local game due to the remote game being paused.
Definition: pausecommand.h:12