Emergency 20 Dokumentation  4.2.0
RedirectTrafficCommand.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
13 #include "em5/command/Command.h"
14 
16 
17 
18 //[-------------------------------------------------------]
19 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23 
24 
25  //[-------------------------------------------------------]
26  //[ Classes ]
27  //[-------------------------------------------------------]
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Public definitions ]
38  //[-------------------------------------------------------]
39  public:
40  static const uint32 PLUGINABLE_ID;
41 
42 
43  //[-------------------------------------------------------]
44  //[ Public methods ]
45  //[-------------------------------------------------------]
46  public:
51  explicit RedirectTrafficCommand(qsf::game::CommandManager* commandManager);
52 
57  static bool getTargetStreet(const qsf::Entity& entity, qsf::ai::SpatialConfiguration3D& result);
58 
59 
60  //[-------------------------------------------------------]
61  //[ Public virtual em5::Command methods ]
62  //[-------------------------------------------------------]
63  public:
64  virtual bool checkAvailable() override;
65  virtual bool checkCaller(qsf::Entity& caller) override;
66  virtual bool checkContext(const qsf::game::CommandContext& context) override;
67  virtual void execute(const qsf::game::CommandContext& context) override;
68 
69 
70  //[-------------------------------------------------------]
71  //[ Private definitions ]
72  //[-------------------------------------------------------]
73  private:
74  static const uint32 ACTION_PRIORITY;
75 
76 
77  //[-------------------------------------------------------]
78  //[ CAMP reflection system ]
79  //[-------------------------------------------------------]
80  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
81 
82 
83  };
84 
85 
86 //[-------------------------------------------------------]
87 //[ Namespace ]
88 //[-------------------------------------------------------]
89 } // em5
90 
91 
92 //[-------------------------------------------------------]
93 //[ CAMP reflection system ]
94 //[-------------------------------------------------------]
Command manager implementation.
Definition: CommandManager.h:49
Definition: ActionPriority.h:13
static const uint32 PLUGINABLE_ID
"em5::RedirectTrafficCommand" unique command pluginable ID
Definition: RedirectTrafficCommand.h:40
virtual bool checkAvailable() override
Check whether the command is currently available at all.
Entity class.
Definition: Entity.h:46
virtual bool checkContext(const qsf::game::CommandContext &context) override
Check whether the command can be executed with the given context.
unsigned int uint32
Definition: PlatformTypes.h:181
RedirectTrafficCommand(qsf::game::CommandManager *commandManager)
Constructor.
Abstract EMERGENCY 5 command base class.
Definition: Command.h:44
EMERGENCY 5 Redirect traffic command.
Definition: RedirectTrafficCommand.h:32
static bool getTargetStreet(const qsf::Entity &entity, qsf::ai::SpatialConfiguration3D &result)
Find a target in the center of the closest street-half.
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
virtual bool checkCaller(qsf::Entity &caller) override
Check whether the command can be executed by the given caller entity.
virtual void execute(const qsf::game::CommandContext &context) override
Execute command for given context.
Command context base class.
Definition: CommandContext.h:48