Terminus
preparenewgamecommand.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace terminus
6 {
7 
14 {
15 public:
17  PrepareNewGameCommand(Timer::TimerMSec timeStamp, QJsonObject jsonObject);
18 
19  virtual QJsonObject toJson() const override;
20  virtual void doWork() override;
21 
22  virtual Commands commandType() const override;
23 
24  bool isPlayerOne() const;
25  unsigned int terrainSeed() const;
26 protected:
28  unsigned int m_terrainSeed;
29 };
30 
31 }
virtual QJsonObject toJson() const override
Every command must define how its members can be serialized.
Definition: preparenewgamecommand.cpp:24
PrepareNewGameCommand(Timer::TimerMSec timeStamp, bool isPlayerOne, unsigned int terrainSeed)
Definition: preparenewgamecommand.cpp:9
The PrepareNewGameCommand is sent to the client when a multiplayer session begins to synchronize the ...
Definition: preparenewgamecommand.h:13
unsigned int m_terrainSeed
Definition: preparenewgamecommand.h:28
bool m_isPlayerOne
Definition: preparenewgamecommand.h:27
unsigned int terrainSeed() const
Definition: preparenewgamecommand.cpp:49
Commands
The Commands enum stores all command types with corresponding ID.
Definition: commands.h:9
virtual Commands commandType() const override
Every Command must specify its type.
Definition: preparenewgamecommand.cpp:39
signed int TimerMSec
Definition: timer.h:22
virtual void doWork() override
Every Commands must define its effects on the receiving game.
Definition: preparenewgamecommand.cpp:32
bool isPlayerOne() const
Definition: preparenewgamecommand.cpp:44
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
The AbstractCommand class defines the interface that every command has to implement.
Definition: abstractcommand.h:23