Emergency 20 Dokumentation  4.2.0
SendDogForSearchCommand.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  //[-------------------------------------------------------]
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:
49  explicit SendDogForSearchCommand(qsf::game::CommandManager* commandManager);
50  SendDogForSearchCommand(qsf::game::CommandManager* commandManager, uint32 pluginableId);
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  //[ Protected virtual methods ]
65  //[-------------------------------------------------------]
66  protected:
67  virtual qsf::Entity* getNextTarget(qsf::Entity& callerEntity, bool& anyFound);
68 
69 
70  //[-------------------------------------------------------]
71  //[ Private methods ]
72  //[-------------------------------------------------------]
73  protected:
74  void initValues();
75 
76  void getAllHiddenBlockedPersons(std::vector<qsf::Entity*>& resultList, qsf::Entity& callerEntity);
77  void getAllBlockedInVehicles(std::vector<qsf::Entity*>& resultList, qsf::Entity& callerEntity);
78  qsf::Entity* getClosestInsideRange(const std::vector<qsf::Entity*>& entityList, const glm::vec3& position, float searchRange);
79 
80 
81  //[-------------------------------------------------------]
82  //[ Private definitions ]
83  //[-------------------------------------------------------]
84  private:
85  static const uint32 ACTION_PRIORITY;
86 
87 
88  //[-------------------------------------------------------]
89  //[ CAMP reflection system ]
90  //[-------------------------------------------------------]
91  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
92 
93 
94  };
95 
96 
97 //[-------------------------------------------------------]
98 //[ Namespace ]
99 //[-------------------------------------------------------]
100 } // em5
101 
102 
103 //[-------------------------------------------------------]
104 //[ CAMP reflection system ]
105 //[-------------------------------------------------------]
Command manager implementation.
Definition: CommandManager.h:49
Definition: ActionPriority.h:13
virtual bool checkContext(const qsf::game::CommandContext &context) override
Check whether the command can be executed with the given context.
Entity class.
Definition: Entity.h:46
SendDogForSearchCommand(qsf::game::CommandManager *commandManager)
Constructor.
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.
unsigned int uint32
Definition: PlatformTypes.h:181
qsf::Entity * getClosestInsideRange(const std::vector< qsf::Entity * > &entityList, const glm::vec3 &position, float searchRange)
EMERGENCY 5 send rescue dog out for search command.
Definition: SendDogForSearchCommand.h:30
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
static const uint32 PLUGINABLE_ID
"em5::SendDogForSearchCommand" unique command pluginable ID
Definition: SendDogForSearchCommand.h:38
virtual qsf::Entity * getNextTarget(qsf::Entity &callerEntity, bool &anyFound)
void getAllBlockedInVehicles(std::vector< qsf::Entity * > &resultList, qsf::Entity &callerEntity)
virtual bool checkAvailable() override
Check whether the command is currently available at all.
Command context base class.
Definition: CommandContext.h:48
void getAllHiddenBlockedPersons(std::vector< qsf::Entity * > &resultList, qsf::Entity &callerEntity)