Emergency 20 Dokumentation  4.2.0
Achievement.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 //[-------------------------------------------------------]
14 
16 
17 
18 //[-------------------------------------------------------]
19 //[ Namespace ]
20 //[-------------------------------------------------------]
21 namespace em5
22 {
23 
24 
25  //[-------------------------------------------------------]
26  //[ Classes ]
27  //[-------------------------------------------------------]
33  {
34 
35 
36  //[-------------------------------------------------------]
37  //[ Public definitions ]
38  //[-------------------------------------------------------]
39  public:
41  {
43  TITLE_ACHIEVEMENT
44  };
45 
46  // Represents the game mode where you can unlock the achievement
48  {
54  MULTIPLAY_AGAINST
55  };
56 
57 
58  //[-------------------------------------------------------]
59  //[ Public methods ]
60  //[-------------------------------------------------------]
61  public:
66  Achievement(const std::string& name, const std::string& title, const std::string& description, const std::string& icon, uint32 points,
67  AchievementType achievementType, float neededProgress, AchievementPlace achievementPlace, VersionSwitch::Edition achievementEdition);
68 
73  Achievement(const std::string& name, const std::string& title, const std::string& icon, AchievementType achievementType = NORMAL_ACHIEVEMENT,
74  float neededPoints = 0.0f, AchievementPlace achievementPlace = GENERAL, VersionSwitch::Edition achievementEdition = VersionSwitch::Edition::STANDARD);
75 
80  AchievementType getAchievementType() const;
81 
86  AchievementPlace getAchievementPlace() const;
87 
92  std::string getIconName() const;
93 
98  std::string getMiniIconName() const;
99 
104  VersionSwitch::Edition getEdition() const;
105 
110  uint32 getCampaignIndex() const;
111 
112 
113  //[-------------------------------------------------------]
114  //[ Public virtual qsf::game::Achievement methods ]
115  //[-------------------------------------------------------]
116  public:
117  virtual void serialize(qsf::BinarySerializer& serializer) override;
118 
119 
120  //[-------------------------------------------------------]
121  //[ Public data ]
122  //[-------------------------------------------------------]
123  public:
124  std::string mTitle;
125  std::string mDescription;
127 
128 
129  //[-------------------------------------------------------]
130  //[ Private data ]
131  //[-------------------------------------------------------]
132  private:
133  std::string mIcon;
134  AchievementType mAchievementType;
135  AchievementPlace mAchievementPlace;
136  VersionSwitch::Edition mAchievementEdition;
137 
138 
139  };
140 
141 
142 //[-------------------------------------------------------]
143 //[ Namespace ]
144 //[-------------------------------------------------------]
145 } // em5
Definition: ActionPriority.h:13
EMERGENCY 5 specialized achievement class.
Definition: Achievement.h:32
Definition: Achievement.h:42
Definition: Achievement.h:49
Definition: Achievement.h:51
unsigned int uint32
Definition: PlatformTypes.h:181
#define EM5_API_EXPORT
Definition: Export.h:28
AchievementPlace
Definition: Achievement.h:47
EMERGENCY 5 Standard Edition.
uint32 mPoints
Achievement point value.
Definition: Achievement.h:126
Definition: Achievement.h:53
void serialize(BinarySerializer &serializer, BitFlagSet< STORAGE, ENUM > &bitFlagSet)
Definition: BitFlagSet.h:359
AchievementType
Definition: Achievement.h:40
Edition
Definition: VersionSwitch.h:41
Achievement class.
Definition: Achievement.h:45
Definition: Achievement.h:50
Definition: Achievement.h:52
std::string mDescription
Description as localizable text ID.
Definition: Achievement.h:125
Binary serializer class.
Definition: BinarySerializer.h:35
std::string mTitle
Title as localizable text ID.
Definition: Achievement.h:124