Emergency 20 Dokumentation  4.2.0
ExtinguishWithExtinguisherCommand.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 //[-------------------------------------------------------]
14 
15 
16 //[-------------------------------------------------------]
17 //[ Namespace ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21 
22 
23  //[-------------------------------------------------------]
24  //[ Classes ]
25  //[-------------------------------------------------------]
31  {
32 
33 
34  //[-------------------------------------------------------]
35  //[ Public definitions ]
36  //[-------------------------------------------------------]
37  public:
38  static const uint32 PLUGINABLE_ID;
39 
40 
41  //[-------------------------------------------------------]
42  //[ Public methods ]
43  //[-------------------------------------------------------]
44  public:
50  explicit ExtinguishWithExtinguisherCommand(qsf::game::CommandManager* commandManager, uint32 commandId);
51 
52 
53  //[-------------------------------------------------------]
54  //[ Public virtual em5::Command methods ]
55  //[-------------------------------------------------------]
56  public:
57  virtual bool checkAvailable() override;
58  virtual bool checkCaller(qsf::Entity& caller) override;
59  virtual bool checkContext(const qsf::game::CommandContext& context) override;
60  virtual void execute(const qsf::game::CommandContext& context) override;
61 
62 
63  //[-------------------------------------------------------]
64  //[ Private methods ]
65  //[-------------------------------------------------------]
66  private:
67  /*
68  * @brief
69  * This function is to insert chain orders. Here we ask very specific states to allow chaining the order at the end of the action plan.
70  * The idea behind the function is to speed up the game play and don't waste time with waiting for finishing action to give new commands
71  */
72  bool isQueueingCommand(qsf::Entity& firefighterEntity);
73 
74 
75  //[-------------------------------------------------------]
76  //[ Private definitions ]
77  //[-------------------------------------------------------]
78  private:
79  static const uint32 ACTION_PRIORITY;
80 
81 
82  //[-------------------------------------------------------]
83  //[ CAMP reflection system ]
84  //[-------------------------------------------------------]
85  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
86 
87 
88  };
89 
90 
91 //[-------------------------------------------------------]
92 //[ Namespace ]
93 //[-------------------------------------------------------]
94 } // em5
95 
96 
97 //[-------------------------------------------------------]
98 //[ CAMP reflection system ]
99 //[-------------------------------------------------------]
Command manager implementation.
Definition: CommandManager.h:49
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
unsigned int uint32
Definition: PlatformTypes.h:181
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.
static const uint32 PLUGINABLE_ID
"em5::ExtinguishWithExtinguisherCommand" unique command pluginable ID
Definition: ExtinguishWithExtinguisherCommand.h:38
EMERGENCY 5 extinguish fire command.
Definition: ExtinguishWithExtinguisherCommand.h:30
virtual bool checkAvailable() override
Check whether the command is currently available at all.
ExtinguishWithExtinguisherCommand(qsf::game::CommandManager *commandManager)
Constructor.
#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 checkContext(const qsf::game::CommandContext &context) override
Check whether the command can be executed with the given context.
EMERGENCY 5 extinguish command base class.
Definition: ExtinguishCoolBaseCommand.h:30
Command context base class.
Definition: CommandContext.h:48