Emergency 20 Dokumentation  4.2.0
EnterVehicleCommand.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 
15 
16 //[-------------------------------------------------------]
17 //[ Namespace ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21 
22 
23  //[-------------------------------------------------------]
24  //[ Classes ]
25  //[-------------------------------------------------------]
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Public definitions ]
39  //[-------------------------------------------------------]
40  public:
41  static const uint32 PLUGINABLE_ID;
42 
43 
44  //[-------------------------------------------------------]
45  //[ Public methods ]
46  //[-------------------------------------------------------]
47  public:
52  explicit EnterVehicleCommand(qsf::game::CommandManager* commandManager);
53 
59 
60 
61  //[-------------------------------------------------------]
62  //[ Public virtual em5::Command methods ]
63  //[-------------------------------------------------------]
64  public:
65  virtual bool checkAvailable() override;
66  virtual bool checkCaller(qsf::Entity& caller) override;
67  virtual bool checkContext(const qsf::game::CommandContext& context) override;
68  virtual void execute(const qsf::game::CommandContext& context) override;
69 
70 
71  //[-------------------------------------------------------]
72  //[ Private methods ]
73  //[-------------------------------------------------------]
74  private:
79  void pushEnterVehicleActions(qsf::ActionComponent& actionComponent, const qsf::game::CommandContext& context);
80  void pushEnterBoatActions(qsf::ActionComponent& actionComponent, const qsf::game::CommandContext& context);
81  void pushEnterTSEKRActions(qsf::ActionComponent& actionComponent, const qsf::game::CommandContext& context);
82 
83  bool isDiverAndBoat(const qsf::game::CommandContext& context);
84  bool isSEKRobotAndTransporter(const qsf::game::CommandContext& context);
85  bool isParamedicAndRescueHeli(const qsf::game::CommandContext& context);
86 
87 
88  //[-------------------------------------------------------]
89  //[ Private definitions ]
90  //[-------------------------------------------------------]
91  private:
92  static const uint32 ACTION_PRIORITY;
93 
94 
95  //[-------------------------------------------------------]
96  //[ CAMP reflection system ]
97  //[-------------------------------------------------------]
98  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
99 
100 
101  };
102 
103 
104 //[-------------------------------------------------------]
105 //[ Namespace ]
106 //[-------------------------------------------------------]
107 } // em5
108 
109 
110 //[-------------------------------------------------------]
111 //[ CAMP reflection system ]
112 //[-------------------------------------------------------]
Command manager implementation.
Definition: CommandManager.h:49
EMERGENCY 5 enter vehicle command.
Definition: EnterVehicleCommand.h:33
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.
Abstract EMERGENCY 5 command base class.
Definition: Command.h:44
virtual bool checkAvailable() override
Check whether the command is currently available at all.
static const uint32 PLUGINABLE_ID
"em5::EnterVehicleCommand" unique command pluginable ID
Definition: EnterVehicleCommand.h:41
bool checkCallerWithoutPriority(qsf::Entity &caller)
Perform the caller check, but skips the priority check. Useful for the check if an action...
#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
EnterVehicleCommand(qsf::game::CommandManager *commandManager)
Constructor.
virtual void execute(const qsf::game::CommandContext &context) override
Execute command for given context.
virtual bool checkContext(const qsf::game::CommandContext &context) override
Check whether the command can be executed with the given context.
Command context base class.
Definition: CommandContext.h:48