Emergency 20 Dokumentation  4.2.0
DebugSelectionInfoWindow.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 <qsf/gui/GuiDocument.h>
14 #include <qsf/job/JobProxy.h>
15 
16 #include <boost/container/flat_set.hpp>
17 #include <boost/container/flat_map.hpp>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Forward declarations ]
22 //[-------------------------------------------------------]
23 namespace Rocket
24 {
25  namespace Core
26  {
27  class ElementText;
28  }
29 }
30 namespace qsf
31 {
32  class Entity;
33  class ContainerLink;
34  struct LinkAnchorId;
35  namespace game
36  {
37  class CommandManager;
38  }
39 }
40 
41 
42 //[-------------------------------------------------------]
43 //[ Namespace ]
44 //[-------------------------------------------------------]
45 namespace em5
46 {
47 
48 
49  //[-------------------------------------------------------]
50  //[ Classes ]
51  //[-------------------------------------------------------]
53  {
54 
55 
56  //[-------------------------------------------------------]
57  //[ Public definitions ]
58  //[-------------------------------------------------------]
59  public:
60  typedef boost::container::flat_set<uint64> EntityIdSet;
61  typedef boost::container::flat_map<qsf::LinkAnchorId, qsf::ContainerLink*> ContainerLinkMap;
62 
63 
64  //[-------------------------------------------------------]
65  //[ Public methods ]
66  //[-------------------------------------------------------]
67  public:
68  explicit DebugSelectionInfoWindow(qsf::GuiContext& guiContext);
70 
71  void setEntityIds(const EntityIdSet& entityIds);
72 
73  void updateDebugText(const qsf::JobArguments& jobArguments);
74 
75 
76  //[-------------------------------------------------------]
77  //[ Public virtual qsf::GuiDocument methods ]
78  //[-------------------------------------------------------]
79  public:
80  virtual void processEvent(const std::string& eventKey, Rocket::Core::Event& event) override;
81 
82 
83  //[-------------------------------------------------------]
84  //[ Private methods ]
85  //[-------------------------------------------------------]
86  private:
87  std::string buildDebugText(const EntityIdSet& entitySet) const;
88 
89  void addEntityNameToStringStream(const qsf::Entity& entity, std::stringstream& stringStream) const;
90  void addEntityTransformToStringStream(const qsf::Entity& entity, std::stringstream& stringStream) const;
91 
92  void addEntityTypeAndPropertiesToStringStream(qsf::Entity& entity, std::stringstream& stringStream) const;
93  void addGangsterDetailsToStringStream(qsf::Entity& entity, std::stringstream& stringStream) const;
94 
95  void addEventTagToStringStream(qsf::Entity& entity, std::stringstream& stringStream) const;
96 
97  void addContainedEntitiesToStringStream(qsf::Entity& entity, std::stringstream& stringStream) const;
98 
99  void addActionPlanToStringStream(const qsf::Entity& entity, std::stringstream& stringStream) const;
100 
101  void addLogicToStringStream(const qsf::Entity& entity, std::stringstream& stringStream) const;
102 
103  void addEntityCommandsToStringStream(const qsf::Entity& entity, std::stringstream& stringStream) const;
104  void addCommandNameToStringStream(uint32 commandId, std::stringstream& stringStream, const qsf::game::CommandManager& commandManager) const;
105 
106  void addEntityComponentsToStringStream(qsf::Entity& entity, std::stringstream& stringStream) const;
107 
108  void showText(const std::string& debugText);
109 
110 
111  //[-------------------------------------------------------]
112  //[ Private data ]
113  //[-------------------------------------------------------]
114  private:
115  EntityIdSet mEntityIds;
116  qsf::JobProxy mDebugJobProxy;
117 
118  Rocket::Core::Element* mMessageText;
119 
120 
121  };
122 
123 
124 //[-------------------------------------------------------]
125 //[ Namespace ]
126 //[-------------------------------------------------------]
127 } // em5
Command manager implementation.
Definition: CommandManager.h:49
Definition: ActionPriority.h:13
Job proxy class.
Definition: JobProxy.h:51
Entity class.
Definition: Entity.h:46
DebugSelectionInfoWindow(qsf::GuiContext &guiContext)
unsigned int uint32
Definition: PlatformTypes.h:181
Graphical User Interface (GUI) document base class.
Definition: GuiDocument.h:51
Definition: OverlayComponent.h:29
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
void updateDebugText(const qsf::JobArguments &jobArguments)
Definition: DebugSelectionInfoWindow.h:52
Definition: PickupPersonByParamedicAction.h:21
Ingame Graphical User Interface (GUI) context class.
Definition: GuiContext.h:62
boost::container::flat_set< uint64 > EntityIdSet
Definition: DebugSelectionInfoWindow.h:60
virtual void processEvent(const std::string &eventKey, Rocket::Core::Event &event) override
void setEntityIds(const EntityIdSet &entityIds)
boost::container::flat_map< qsf::LinkAnchorId, qsf::ContainerLink * > ContainerLinkMap
Definition: DebugSelectionInfoWindow.h:61