Emergency 20 Dokumentation  4.2.0
ExitVehicleCommand.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  //[-------------------------------------------------------]
33  class ExitVehicleCommand : public Command
34  {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Static public methods ]
39  //[-------------------------------------------------------]
40  public:
45  static void getEntitiesToExit(qsf::Entity& callerEntity, std::vector<qsf::Entity*>& entitiesToExit);
46 
51  static void getEntitiesToExitWithFilter(qsf::Entity& callerEntity, std::vector<qsf::Entity*>& entitiesToExit, uint64 filterId);
52 
57  static void getEntitiesToExitUnfiltered(qsf::Entity& callerEntity, std::vector<qsf::Entity*>& entitiesToExit);
58 
59 
60  //[-------------------------------------------------------]
61  //[ Public definitions ]
62  //[-------------------------------------------------------]
63  public:
64  static const uint32 PLUGINABLE_ID;
65 
66 
67  //[-------------------------------------------------------]
68  //[ Public methods ]
69  //[-------------------------------------------------------]
70  public:
75  explicit ExitVehicleCommand(qsf::game::CommandManager* commandManager);
76 
77 
78  //[-------------------------------------------------------]
79  //[ Public virtual em5::Command methods ]
80  //[-------------------------------------------------------]
81  public:
82  virtual bool checkAvailable() override;
83  virtual bool checkCaller(qsf::Entity& caller) override;
84  virtual bool checkContext(const qsf::game::CommandContext& context) override;
85  virtual void execute(const qsf::game::CommandContext& context) override;
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
Definition: ActionPriority.h:13
ExitVehicleCommand(qsf::game::CommandManager *commandManager)
Constructor.
Entity class.
Definition: Entity.h:46
virtual void execute(const qsf::game::CommandContext &context) override
Execute command for given context.
unsigned int uint32
Definition: PlatformTypes.h:181
static void getEntitiesToExit(qsf::Entity &callerEntity, std::vector< qsf::Entity * > &entitiesToExit)
Collect entities that should usually be unloaded (e.g. no injureds, arrested gangsters) ...
Abstract EMERGENCY 5 command base class.
Definition: Command.h:44
virtual bool checkCaller(qsf::Entity &caller) override
Check whether the command can be executed by the given caller entity.
uint64_t uint64
Definition: PlatformTypes.h:184
virtual bool checkContext(const qsf::game::CommandContext &context) override
Check whether the command can be executed with the given context.
virtual bool checkAvailable() override
Check whether the command is currently available at all.
static const uint32 PLUGINABLE_ID
"em5::ExitVehicleCommand" unique command pluginable ID
Definition: ExitVehicleCommand.h:64
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
static void getEntitiesToExitUnfiltered(qsf::Entity &callerEntity, std::vector< qsf::Entity * > &entitiesToExit)
Collect entities to unloaded, without the usual filtering, like exclusion of injureds.
EMERGENCY 5 exit vehicle command.
Definition: ExitVehicleCommand.h:33
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
static void getEntitiesToExitWithFilter(qsf::Entity &callerEntity, std::vector< qsf::Entity * > &entitiesToExit, uint64 filterId)
Check for a certain entity to be unloaded (if parameter is initialized, otherwise this does the same ...
Command context base class.
Definition: CommandContext.h:48