Emergency 20 Dokumentation  4.2.0
OrderInfo.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"
15 
20 
21 #include <boost/container/flat_map.hpp>
22 
23 #include <vector>
24 
25 
26 //[-------------------------------------------------------]
27 //[ Forward declarations ]
28 //[-------------------------------------------------------]
29 namespace em5
30 {
31  class VehicleComponent;
32 }
33 
34 
35 //[-------------------------------------------------------]
36 //[ Namespace ]
37 //[-------------------------------------------------------]
38 namespace em5
39 {
40 
41 
42  //[-------------------------------------------------------]
43  //[ Classes ]
44  //[-------------------------------------------------------]
55  {
56 
57 
58  //[-------------------------------------------------------]
59  //[ Public definitions ]
60  //[-------------------------------------------------------]
61  public:
62  typedef std::pair<std::string, uint32> OrderPair;
63  typedef boost::container::flat_map<std::string, uint32> OrderPairList;
64 
65 
66  //[-------------------------------------------------------]
67  //[ Public static methods ]
68  //[-------------------------------------------------------]
69  public:
70  static void getOrderPairListByVehicleComponent(const VehicleComponent& vehicleComponent, OrderPairList& orderPairList);
71 
72 
73  //[-------------------------------------------------------]
74  //[ Public methods ]
75  //[-------------------------------------------------------]
76  public:
81  explicit OrderInfo(uint32 key);
82 
87  virtual ~OrderInfo();
88 
96  uint32 getOrderInfoId() const;
97 
105  const std::string& getName() const;
106 
111  void setName(const std::string& name);
112 
123  const qsf::AssetProxy& getPrefab() const;
124 
135  void setPrefab(const qsf::AssetProxy& prefab);
136 
144  const std::string& getLocalizedName() const;
145 
150  void setLocalizedName(const std::string& name);
151 
156  units::Department getDepartment() const;
157 
162  const std::string& getDepartmentAsString() const;
163 
168  void setDepartment(units::Department department);
169 
174  void setDepartmentAsString(const std::string& department);
175 
183  std::string getUnitTagsAsString() const;
184 
192  void setUnitTagsAsString(const std::string& unitTags);
193 
198  bool hasUnitTag(const qsf::StringHash& tag) const;
199 
204  uint32 getNameSpace() const;
205 
210  void setNameSpace(uint32 space);
211 
222  const std::string& getAvatarIcon() const;
223 
234  void setAvatarIcon(const std::string& name);
235 
246  const std::string& getSelectionIcon() const;
247 
258  void setSelectionIcon(const std::string& name);
259 
264  const std::string& getMiniMapIconType() const;
265 
270  void setMiniMapIconType(const std::string& miniMapIconType);
271 
279  uint32 getOrderCost() const;
280 
288  void setOrderCost(uint32 orderCost);
289 
297  int getOrderSpeed() const;
298 
306  void setOrderSpeed(int orderSpeed);
307 
315  uint32 getUnlockCost() const;
316 
324  void setUnlockCost(uint32 unlockCost);
325 
333  uint32 getNumberAvailable() const;
334 
342  void setNumberAvailable(uint32 numberAvailable);
343 
351  uint32 getPersonnelSpace() const;
352 
360  void setPersonnelSpace(uint32 personnelSpace);
361 
369  uint32 getPassengerSpace() const;
370 
378  void setPassengerSpace(uint32 passengerSpace);
379 
384  void setStartPersonnel(const boost::property_tree::ptree& pTree);
385 
393  const boost::property_tree::ptree& getStartPersonnel() const;
394 
399  const OrderPairList& getStartPersonnelList() const;
400 
405  OrderPairList& getStartPersonnelListForWriting();
406 
414  std::string getSupportedPersonnelAsString() const;
415 
420  void setSupportedPersonnelAsString(const std::string& supported);
421 
430  bool supportsPersonnel(const std::string& personnelUnitTypeName) const;
431 
436  uint32 getSpeakerIndex() const;
437 
442  void setSpeakerIndex(uint32 speakerIndex);
443 
444 
445  //[-------------------------------------------------------]
446  //[ Private definitions ]
447  //[-------------------------------------------------------]
448  private:
449  typedef std::vector<std::string> UnitNameArray;
450  typedef std::vector<qsf::NamedIdentifier> UnitTagArray;
451 
452 
453  //[-------------------------------------------------------]
454  //[ Public data ]
455  //[-------------------------------------------------------]
456  public:
457  std::vector<std::string> mHelpPages;
458 
459 
460  //[-------------------------------------------------------]
461  //[ Private data ]
462  //[-------------------------------------------------------]
463  private:
464  // General
465  qsf::NamedIdentifier mName;
466  qsf::AssetProxy mPrefab;
467 
468  // Metadata
469  std::string mLocalizedName;
470  units::Department mDepartment;
471  UnitTagArray mUnitTags;
472 
473  // GUI-related
474  std::string mAvatarIcon;
475  std::string mSelectionIcon;
476  std::string mMiniMapIconType;
477  uint32 mNameSpace;
478 
479  // Ordering
480  uint32 mOrderCost;
481  int mOrderSpeed;
482  uint32 mUnlockCost;
483  uint32 mNumberAvailable;
484 
485  // Personnel
486  uint32 mPersonnelSpace;
487  uint32 mPassengerSpace;
488  OrderPairList mStandardPersonnel;
489  boost::property_tree::ptree mStartPersonnelPTree;
490  std::vector<qsf::NamedIdentifier> mSupportedPersonnel; // Unit types of persons that may enter the vehicle in addition to the standard personnel
491 
492  uint32 mSpeakerIndex;
493 
494 
495  //[-------------------------------------------------------]
496  //[ CAMP reflection system ]
497  //[-------------------------------------------------------]
498  QSF_CAMP_RTTI() // Only adds the virtual method "campClassId()", nothing more
499 
500 
501  };
502 
503 
504 //[-------------------------------------------------------]
505 //[ Namespace ]
506 //[-------------------------------------------------------]
507 } // em5
508 
509 
510 //[-------------------------------------------------------]
511 //[ CAMP reflection system ]
512 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
Object base class.
Definition: Object.h:68
Order information.
Definition: OrderInfo.h:54
unsigned int uint32
Definition: PlatformTypes.h:181
Department
Definition: Department.h:19
#define EM5_API_EXPORT
Definition: Export.h:28
Vehicle component base class.
Definition: VehicleComponent.h:49
std::pair< std::string, uint32 > OrderPair
Definition: OrderInfo.h:62
Asset proxy class.
Definition: AssetProxy.h:57
#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
Definition: DensityCalculator.h:29
boost::container::flat_map< std::string, uint32 > OrderPairList
Definition: OrderInfo.h:63
Class combining strings with their hashes.
Definition: NamedIdentifier.h:34
std::vector< std::string > mHelpPages
Definition: OrderInfo.h:457
Compile time string hash class.
Definition: StringHash.h:59