Emergency 20 Dokumentation  4.2.0
ReturnToBaseCommand.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"
15 
16 
17 //[-------------------------------------------------------]
18 //[ Namespace ]
19 //[-------------------------------------------------------]
20 namespace em5
21 {
22 
23 
24  //[-------------------------------------------------------]
25  //[ Classes ]
26  //[-------------------------------------------------------]
32  {
33 
34 
35  //[-------------------------------------------------------]
36  //[ Public definitions ]
37  //[-------------------------------------------------------]
38  public:
39  static const uint32 PLUGINABLE_ID;
40 
41 
42  //[-------------------------------------------------------]
43  //[ Public static methods ]
44  //[-------------------------------------------------------]
45  public:
46  static void pushReturnToBaseAction(qsf::Entity& caller, action::Priority actionPriority);
47  static void pushActionsBeforeMovement(qsf::Entity& caller, qsf::ActionComponent& actionComponent, action::Priority actionPriority);
48  static bool isInEmergencyMode(qsf::Entity& caller);
49 
50 
51  //[-------------------------------------------------------]
52  //[ Public methods ]
53  //[-------------------------------------------------------]
54  public:
59  explicit ReturnToBaseCommand(qsf::game::CommandManager* commandManager);
60 
61 
62  //[-------------------------------------------------------]
63  //[ Public virtual em5::Command methods ]
64  //[-------------------------------------------------------]
65  public:
66  virtual bool checkAvailable() override;
67  virtual bool checkCaller(qsf::Entity& caller) override;
68  virtual bool checkContext(const qsf::game::CommandContext& context) override;
69  virtual void execute(const qsf::game::CommandContext& context) override;
70 
71 
72  //[-------------------------------------------------------]
73  //[ Protected methods ]
74  //[-------------------------------------------------------]
75  protected:
76  ReturnToBaseCommand(qsf::game::CommandManager* commandManager, uint32 commandId);
77 
78 
79  //[-------------------------------------------------------]
80  //[ Private definitions ]
81  //[-------------------------------------------------------]
82  private:
83  static const uint32 ACTION_PRIORITY;
84 
85 
86  //[-------------------------------------------------------]
87  //[ CAMP reflection system ]
88  //[-------------------------------------------------------]
89  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
90 
91 
92  };
93 
94 
95 //[-------------------------------------------------------]
96 //[ Namespace ]
97 //[-------------------------------------------------------]
98 } // em5
99 
100 
101 //[-------------------------------------------------------]
102 //[ CAMP reflection system ]
103 //[-------------------------------------------------------]
Command manager implementation.
Definition: CommandManager.h:49
Definition: ActionPriority.h:13
Entity class.
Definition: Entity.h:46
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
Abstract EMERGENCY 5 command base class.
Definition: Command.h:44
#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
Action component.
Definition: ActionComponent.h:47
EMERGENCY 5 return to base command.
Definition: ReturnToBaseCommand.h:31
Priority
Definition: ActionPriority.h:20
static const uint32 PLUGINABLE_ID
"em5::ReturnToBaseCommand" unique command pluginable ID
Definition: ReturnToBaseCommand.h:39
Command context base class.
Definition: CommandContext.h:48