1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
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.
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
22 #include "entity_sheet.h"
24 #include "game_share/skills.h"
25 #include "game_share/character_title.h"
27 class CUnblockTitlesSheet
: public CEntitySheet
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
;
48 uint32 OrganizerRating
;
49 std::vector
<std::vector
<NLMISC::CSheetId
> > ItemsNeeded
;
50 std::vector
<std::vector
<sint32
> > ItemsQualityNeeded
;
52 // -----------------------------------------------------
54 STitleUnblock() : Reserved(false)
61 void serial(NLMISC::IStream
&f
)
70 size
= uint16(SkillsNeeded
.size());
73 SkillsNeeded
.resize (size
);
74 for (i
= 0; i
< size
; ++i
)
78 sizeTmp
= uint16(SkillsNeeded
[i
].size());
81 SkillsNeeded
[i
].resize (sizeTmp
);
82 for (j
= 0; j
< sizeTmp
; ++j
)
83 f
.serial (SkillsNeeded
[i
][j
]);
87 size
= uint16(SkillsLevelNeeded
.size());
90 SkillsLevelNeeded
.resize (size
);
91 for (i
= 0; i
< size
; ++i
)
92 f
.serialCont (SkillsLevelNeeded
[i
]);
96 size
= uint16(BricksNeeded
.size());
99 BricksNeeded
.resize (size
);
100 for (i
= 0; i
< size
; ++i
)
101 f
.serial (BricksNeeded
[i
]);
105 size
= uint16(MinFames
.size());
108 MinFames
.resize (size
);
109 for (i
= 0; i
< size
; ++i
)
110 f
.serial (MinFames
[i
]);
113 size
= uint16(MinFameLevels
.size());
116 MinFameLevels
.resize (size
);
117 for (i
= 0; i
< size
; ++i
)
118 f
.serial (MinFameLevels
[i
]);
121 size
= uint16(MaxFames
.size());
124 MaxFames
.resize (size
);
125 for (i
= 0; i
< size
; ++i
)
126 f
.serial (MaxFames
[i
]);
129 size
= uint16(MaxFameLevels
.size());
132 MaxFameLevels
.resize (size
);
133 for (i
= 0; i
< size
; ++i
)
134 f
.serial (MaxFameLevels
[i
]);
136 // civ & cult (allegiances)
138 f
.serial(CultNeeded
);
140 // char and account time properties
141 f
.serial(CharOldness
);
142 f
.serial(CharPlayedTime
);
143 f
.serial(AccountOldness
);
146 f
.serial(AuthorRating
);
148 f
.serial(OrganizerRating
);
152 size
= uint16(ItemsNeeded
.size());
155 ItemsNeeded
.resize (size
);
156 for (i
= 0; i
< size
; ++i
)
160 sizeTmp
= uint16(ItemsNeeded
[i
].size());
163 ItemsNeeded
[i
].resize (sizeTmp
);
164 for (j
= 0; j
< sizeTmp
; ++j
)
165 f
.serial (ItemsNeeded
[i
][j
]);
169 size
= uint16(ItemsQualityNeeded
.size());
172 ItemsQualityNeeded
.resize (size
);
173 for (i
= 0; i
< size
; ++i
)
174 f
.serialCont (ItemsQualityNeeded
[i
]);
181 CUnblockTitlesSheet()
183 Type
= UNBLOCK_TITLES
;
186 virtual ~CUnblockTitlesSheet() {}
188 virtual void build(const NLGEORGES::UFormElm
&item
);
191 virtual void serial(NLMISC::IStream
&f
)
193 f
.serialCont(TitlesUnblock
);
198 std::vector
< STitleUnblock
> TitlesUnblock
; // There is NB_CHARACTER_TITLE TitleUnblock
201 #endif // CL_UNBLOCK_TITLES_SHEET_H