Terminus
projectilefiredcommand.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <QVector3D>
4 
6 
7 namespace terminus
8 {
9 
21 {
22 public:
24  ProjectileFiredCommand(Timer::TimerMSec timeStamp, QJsonObject jsonObject);
25 
26  virtual QJsonObject toJson() const override;
27  virtual void doWork() override;
28 
29  virtual Commands commandType() const override;
30 
31  QVector3D startPosition() const;
32  QVector3D velocity() const;
33 
34 protected:
35 
36  QVector3D m_startPosition;
37  QVector3D m_velocity;
38 };
39 
40 }
The ProjectileFiredCommand indicates that a projectile has been fired and contains the position as we...
Definition: projectilefiredcommand.h:20
QVector3D startPosition() const
Definition: projectilefiredcommand.cpp:51
QVector3D m_startPosition
Definition: projectilefiredcommand.h:36
QVector3D m_velocity
Definition: projectilefiredcommand.h:37
QVector3D velocity() const
Definition: projectilefiredcommand.cpp:56
Commands
The Commands enum stores all command types with corresponding ID.
Definition: commands.h:9
signed int TimerMSec
Definition: timer.h:22
ProjectileFiredCommand(Timer::TimerMSec timeStamp, QVector3D startPosition, QVector3D velocity)
Definition: projectilefiredcommand.cpp:11
virtual void doWork() override
Every Commands must define its effects on the receiving game.
Definition: projectilefiredcommand.cpp:34
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 QJsonObject toJson() const override
Every command must define how its members can be serialized.
Definition: projectilefiredcommand.cpp:26
virtual Commands commandType() const override
Every Command must specify its type.
Definition: projectilefiredcommand.cpp:46
The AbstractCommand class defines the interface that every command has to implement.
Definition: abstractcommand.h:23