Emergency 20 Dokumentation  4.2.0
Command.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/Export.h"
14 
16 
17 
18 //[-------------------------------------------------------]
19 //[ Forward declarations ]
20 //[-------------------------------------------------------]
21 namespace qsf
22 {
23  namespace game
24  {
25  class CommandManager;
26  }
27 }
28 
29 
30 //[-------------------------------------------------------]
31 //[ Namespace ]
32 //[-------------------------------------------------------]
33 namespace em5
34 {
35 
36 
37  //[-------------------------------------------------------]
38  //[ Classes ]
39  //[-------------------------------------------------------]
45  {
46 
47 
48  //[-------------------------------------------------------]
49  //[ Public definitions ]
50  //[-------------------------------------------------------]
51  public:
52  struct IconSettings
53  {
54  bool mShowAsGuiButton; // "true" if commando has an representation as button
55  bool mStartCommandMode; // "true" if activating starts a special mode
56  bool mEnabledInMultiplay; // "true" if it is usable in multiplay
57  std::string mButtonIconPath; // Path of the button icon
58  std::string mMouseIconName; // Name of the mouse icon (this name is used to set the new cursor via librocket)
59  std::string mTooltip; // Tooltip string
60 
62  mShowAsGuiButton(false),
63  mStartCommandMode(false),
64  mEnabledInMultiplay(true)
65  {}
66  };
67 
68 
69  //[-------------------------------------------------------]
70  //[ Public methods ]
71  //[-------------------------------------------------------]
72  public:
73  virtual const IconSettings& getIconSettings() const;
74 
79  virtual bool highlightTarget() const;
80 
85  const std::string& getHelpPageName() const;
86 
91  int32 getButtonPriority() const;
92 
93 
94  //[-------------------------------------------------------]
95  //[ Protected methods ]
96  //[-------------------------------------------------------]
97  protected:
105  Command(qsf::game::CommandManager* commandManager, uint32 commandId);
106 
111  bool checkCallerActionPriorityNoBlocking(qsf::Entity& caller, uint32 maximumPriority) const;
112 
113 
114  //[-------------------------------------------------------]
115  //[ Protected data ]
116  //[-------------------------------------------------------]
117  protected:
119  std::string mHelpPageName;
121 
122 
123  //[-------------------------------------------------------]
124  //[ CAMP reflection system ]
125  //[-------------------------------------------------------]
126  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
127 
128 
129  };
130 
131 
132 //[-------------------------------------------------------]
133 //[ Namespace ]
134 //[-------------------------------------------------------]
135 } // em5
136 
137 
138 //[-------------------------------------------------------]
139 //[ CAMP reflection system ]
140 //[-------------------------------------------------------]
Command manager implementation.
Definition: CommandManager.h:49
Definition: ActionPriority.h:13
std::string mHelpPageName
Holds the corresponding help page name.
Definition: Command.h:119
bool mShowAsGuiButton
Definition: Command.h:54
Entity class.
Definition: Entity.h:46
Definition: Command.h:52
bool mStartCommandMode
Definition: Command.h:55
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
int32 mButtonPriority
Priority of command buttons on screen (Bigger priority comes first)
Definition: Command.h:120
std::string mButtonIconPath
Definition: Command.h:57
std::string mMouseIconName
Definition: Command.h:58
Definition: PickupPersonByParamedicAction.h:21
IconSettings()
Definition: Command.h:61
#define QSF_CAMP_RTTI()
Only adds the virtual method "campClassId()", nothing more.
Definition: CampClass.h:75
bool mEnabledInMultiplay
Definition: Command.h:56
#define QSF_CAMP_TYPE_NONCOPYABLE(type)
See "CAMP_TYPE_NONCOPYABLE" for details.
Definition: CampClass.h:112
signed int int32
Definition: PlatformTypes.h:180
IconSettings mIconSettings
The command's icon settings structure.
Definition: Command.h:118
std::string mTooltip
Definition: Command.h:59
Abstract command base class.
Definition: Command.h:50