Terminus
projectilehitcommand.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace terminus
6 {
16 {
17 public:
19  ProjectileHitCommand(Timer::TimerMSec timeStamp, QJsonObject jsonObject);
20 
21  virtual QJsonObject toJson() const override;
22  virtual void doWork() override;
23 
24  virtual Commands commandType() const override { return Commands::Command_ProjectileHit; }
25 
26  bool rightTrain() const { return m_rightTrain; }
27  int wagonIndex() const { return m_wagonIndex; }
28  float damage() const { return m_damage; }
29 protected:
30 
33  float m_damage;
34 };
35 
36 } // namespace terminus
The ProjectileHitCommand indicates that a projectile hit a wagon. It contains the wagonIndex as well ...
Definition: projectilehitcommand.h:15
Definition: commands.h:13
virtual QJsonObject toJson() const override
Every command must define how its members can be serialized.
Definition: projectilehitcommand.cpp:29
int wagonIndex() const
Definition: projectilehitcommand.h:27
ProjectileHitCommand(Timer::TimerMSec timeStamp, bool rightTrain, int wagonIndex, float damage)
Definition: projectilehitcommand.cpp:12
Commands
The Commands enum stores all command types with corresponding ID.
Definition: commands.h:9
float damage() const
Definition: projectilehitcommand.h:28
virtual Commands commandType() const override
Every Command must specify its type.
Definition: projectilehitcommand.h:24
bool m_rightTrain
Definition: projectilehitcommand.h:31
signed int TimerMSec
Definition: timer.h:22
float m_damage
Definition: projectilehitcommand.h:33
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
bool rightTrain() const
Definition: projectilehitcommand.h:26
The AbstractCommand class defines the interface that every command has to implement.
Definition: abstractcommand.h:23
virtual void doWork() override
Every Commands must define its effects on the receiving game.
Definition: projectilehitcommand.cpp:38
int m_wagonIndex
Definition: projectilehitcommand.h:32