// Ryzom - MMORPG Framework // Copyright (C) 2010 Winch Gate Property Limited // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . /* Copyright, 2000 Nevrax Ltd. * * This file is part of NEVRAX NEL. * NEVRAX NEL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * NEVRAX NEL is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * You should have received a copy of the GNU General Public License * along with NEVRAX NEL; see the file COPYING. If not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. */ #ifndef SKILL_TREE_H #define SKILL_TREE_H // Misc #include "nel/misc/types_nl.h" #include "nel/misc/stream.h" #include "nel/misc/smart_ptr.h" #include "nel/misc/sheet_id.h" // Georges #include "nel/georges/u_form.h" #include "nel/georges/u_form_elm.h" //#include "nel/georges/u_form_dfn.h" //#include "nel/georges/u_form_loader.h" //#include "nel/georges/u_type.h" #include "game_share/skills.h" #include #include /** * CStaticSkillsTree * * \author Alain Saffray * \author Nevrax France * \date 2002 */ class CStaticSkillsTree { public : struct SSkillData { SKILLS::ESkills Skill; std::string SkillCode; uint16 MaxSkillValue; uint16 StageType; SKILLS::ESkills ParentSkill; std::vector ChildSkills; void serial(class NLMISC::IStream &f) throw(NLMISC::EStream) { f.serialEnum( Skill ); f.serial( SkillCode ); f.serial( MaxSkillValue ); f.serial( StageType ); f.serialEnum( ParentSkill ); if( f.isReading() ) { uint16 size; f.serial( size ); ChildSkills.resize( size ); for( uint i = 0; i < size; ++i ) { f.serialEnum( ChildSkills[ i ] ); } } else { uint16 size = ChildSkills.size(); f.serial( size ); for( std::vector::iterator it = ChildSkills.begin(); it != ChildSkills.end(); ++it ) { f.serialEnum( (*it) ); } } } }; /// read sheet virtual void readGeorges( const NLMISC::CSmartPtr &form, const NLMISC::CSheetId &sheetId ); // return the version of this class, increments this value when the content of this class changed static uint getVersion () { return 1 + ( SKILLS::NUM_SKILLS << 16 ); } /// serialize void serial(class NLMISC::IStream &f) throw(NLMISC::EStream) { f.serialCont( SkillsTree ); } /// destructor virtual ~CStaticSkillsTree() {} /// called when the sheet is removed void removed() {} std::vector< SSkillData > SkillsTree; }; #endif // SKILL_TREE_H /* End of skill_tree.h */