Linux multi-monitor fullscreen support
[ryzomcore.git] / ryzom / client / src / client_sheets / skills_tree_sheet.h
blobb65115148c6ff28d6e5b78c789bc01732d29e4e0
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_SKILLS_TREE_SHEET_H
19 #define CL_SKILLS_TREE_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 CSkillsTreeSheet : public CEntitySheet
29 public :
30 struct SSkillData
32 SKILLS::ESkills Skill;
33 std::string SkillCode;
34 uint16 MaxSkillValue;
35 uint16 StageType;
36 SKILLS::ESkills ParentSkill;
37 std::vector<SKILLS::ESkills> ChildSkills;
39 // ---------------------------------------------
41 SSkillData()
43 ParentSkill = Skill = SKILLS::unknown;
44 MaxSkillValue = StageType = 0;
47 void serial(NLMISC::IStream &f)
49 f.serialEnum (Skill);
50 f.serial (SkillCode);
51 f.serial (MaxSkillValue);
52 f.serial (StageType);
53 f.serialEnum (ParentSkill);
55 if (f.isReading())
57 uint16 size;
58 f.serial (size);
59 ChildSkills.resize (size);
60 for (uint i = 0; i < size; ++i)
62 f.serialEnum (ChildSkills[i]);
65 else
67 uint16 size = uint16(ChildSkills.size());
68 f.serial (size);
69 for (std::vector<SKILLS::ESkills>::iterator it = ChildSkills.begin(); it != ChildSkills.end(); ++it)
71 f.serialEnum ((*it));
78 public:
80 CSkillsTreeSheet()
82 Type = SKILLS_TREE;
84 /// destructor
85 virtual ~CSkillsTreeSheet() {}
87 virtual void build(const NLGEORGES::UFormElm &item);
89 /// serialize
90 virtual void serial(NLMISC::IStream &f)
92 f.serialCont( SkillsTree );
95 public:
97 std::vector< SSkillData > SkillsTree;
100 #endif // CL_SKILLS_TREE_SHEET_H