Fix css style order when using external css files
[ryzomcore.git] / ryzom / client / src / client_sheets / unblock_titles_sheet.h
blob32189f01951ce847e02016385d650df1f8bbc76c
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef CL_UNBLOCK_TITLES_SHEET_H
19 #define CL_UNBLOCK_TITLES_SHEET_H
21 // Application
22 #include "entity_sheet.h"
23 // Game Share
24 #include "game_share/skills.h"
25 #include "game_share/character_title.h"
27 class CUnblockTitlesSheet : public CEntitySheet
29 public :
31 struct STitleUnblock
33 bool Reserved; // Title unblock only by server message
34 std::vector<std::vector<std::string> > SkillsNeeded;
35 std::vector<std::vector<sint32> > SkillsLevelNeeded;
36 std::vector<NLMISC::CSheetId> BricksNeeded;
37 std::vector<uint32> MinFames;
38 std::vector<sint32> MinFameLevels;
39 std::vector<uint32> MaxFames;
40 std::vector<sint32> MaxFameLevels;
41 std::string CivNeeded;
42 std::string CultNeeded;
43 std::string CharOldness;
44 std::string CharPlayedTime;
45 std::string AccountOldness;
46 uint32 AuthorRating;
47 uint32 AMRating;
48 uint32 OrganizerRating;
49 std::vector<std::vector<NLMISC::CSheetId> > ItemsNeeded;
50 std::vector<std::vector<sint32> > ItemsQualityNeeded;
52 // -----------------------------------------------------
54 STitleUnblock() : Reserved(false)
56 AuthorRating = 0;
57 AMRating = 0;
58 OrganizerRating = 0;
61 void serial(NLMISC::IStream &f)
63 uint i,j;
65 f.serial (Reserved);
67 // skills
68 uint16 size;
69 if (!f.isReading())
70 size = uint16(SkillsNeeded.size());
71 f.serial (size);
72 if (f.isReading())
73 SkillsNeeded.resize (size);
74 for (i = 0; i < size; ++i)
76 uint16 sizeTmp;
77 if (!f.isReading())
78 sizeTmp = uint16(SkillsNeeded[i].size());
79 f.serial(sizeTmp);
80 if (f.isReading())
81 SkillsNeeded[i].resize (sizeTmp);
82 for (j = 0; j < sizeTmp; ++j)
83 f.serial (SkillsNeeded[i][j]);
86 if (!f.isReading())
87 size = uint16(SkillsLevelNeeded.size());
88 f.serial (size);
89 if (f.isReading())
90 SkillsLevelNeeded.resize (size);
91 for (i = 0; i < size; ++i)
92 f.serialCont (SkillsLevelNeeded[i]);
94 // bricks
95 if (!f.isReading())
96 size = uint16(BricksNeeded.size());
97 f.serial (size);
98 if (f.isReading())
99 BricksNeeded.resize (size);
100 for (i = 0; i < size; ++i)
101 f.serial (BricksNeeded[i]);
103 // fames
104 if (!f.isReading())
105 size = uint16(MinFames.size());
106 f.serial (size);
107 if (f.isReading())
108 MinFames.resize (size);
109 for (i = 0; i < size; ++i)
110 f.serial (MinFames[i]);
112 if (!f.isReading())
113 size = uint16(MinFameLevels.size());
114 f.serial (size);
115 if (f.isReading())
116 MinFameLevels.resize (size);
117 for (i = 0; i < size; ++i)
118 f.serial (MinFameLevels[i]);
120 if (!f.isReading())
121 size = uint16(MaxFames.size());
122 f.serial (size);
123 if (f.isReading())
124 MaxFames.resize (size);
125 for (i = 0; i < size; ++i)
126 f.serial (MaxFames[i]);
128 if (!f.isReading())
129 size = uint16(MaxFameLevels.size());
130 f.serial (size);
131 if (f.isReading())
132 MaxFameLevels.resize (size);
133 for (i = 0; i < size; ++i)
134 f.serial (MaxFameLevels[i]);
136 // civ & cult (allegiances)
137 f.serial(CivNeeded);
138 f.serial(CultNeeded);
140 // char and account time properties
141 f.serial(CharOldness);
142 f.serial(CharPlayedTime);
143 f.serial(AccountOldness);
145 // ring ratings
146 f.serial(AuthorRating);
147 f.serial(AMRating);
148 f.serial(OrganizerRating);
150 // items
151 if (!f.isReading())
152 size = uint16(ItemsNeeded.size());
153 f.serial (size);
154 if (f.isReading())
155 ItemsNeeded.resize (size);
156 for (i = 0; i < size; ++i)
158 uint16 sizeTmp;
159 if (!f.isReading())
160 sizeTmp = uint16(ItemsNeeded[i].size());
161 f.serial(sizeTmp);
162 if (f.isReading())
163 ItemsNeeded[i].resize (sizeTmp);
164 for (j = 0; j < sizeTmp; ++j)
165 f.serial (ItemsNeeded[i][j]);
168 if (!f.isReading())
169 size = uint16(ItemsQualityNeeded.size());
170 f.serial (size);
171 if (f.isReading())
172 ItemsQualityNeeded.resize (size);
173 for (i = 0; i < size; ++i)
174 f.serialCont (ItemsQualityNeeded[i]);
179 public:
181 CUnblockTitlesSheet()
183 Type = UNBLOCK_TITLES;
185 /// destructor
186 virtual ~CUnblockTitlesSheet() {}
188 virtual void build(const NLGEORGES::UFormElm &item);
190 /// serialize
191 virtual void serial(NLMISC::IStream &f)
193 f.serialCont(TitlesUnblock);
196 public:
198 std::vector< STitleUnblock > TitlesUnblock; // There is NB_CHARACTER_TITLE TitleUnblock
201 #endif // CL_UNBLOCK_TITLES_SHEET_H