26 virtual QJsonObject
toJson()
const override;
27 virtual void doWork()
override;
The SyncCommand is used to keep shared game state synchronized.
Definition: synccommand.h:20
virtual void doWork() override
Every Commands must define its effects on the receiving game.
Definition: synccommand.cpp:61
const std::vector< float > & wagonHealthVector() const
Definition: synccommand.h:31
Definition: commands.h:15
float m_velocity
Definition: synccommand.h:34
Commands
The Commands enum stores all command types with corresponding ID.
Definition: commands.h:9
signed int TimerMSec
Definition: timer.h:22
std::vector< float > m_wagonHealthVector
Definition: synccommand.h:33
virtual Commands commandType() const override
Every Command must specify its type.
Definition: synccommand.h:29
Definition: eventhandler.cpp:18
virtual QJsonObject toJson() const override
Every command must define how its members can be serialized.
Definition: synccommand.cpp:43
Timer::TimerMSec timeStamp() const
get the time as counted by the sending game that this command was created and sent ...
Definition: abstractcommand.cpp:54
float m_travelledDistance
Definition: synccommand.h:35
SyncCommand(Timer::TimerMSec timeStamp, const Train &playerTrain)
Definition: synccommand.cpp:15
The AbstractCommand class defines the interface that every command has to implement.
Definition: abstractcommand.h:23
The Train class works as a logical container for all wagons one train consists of.
Definition: train.h:25