Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / client / src / animation_fx_id_array.h
blob950845c5b2b3c6e7db8aceef251e241ff3bf60a5
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/>.
19 #ifndef CL_ANIMATION_FX_ID_ARRAY_H
20 #define CL_ANIMATION_FX_ID_ARRAY_H
22 #include "animation_fx.h"
24 class CIDToStringArraySheet;
26 namespace NL3D
28 class UAnimationSet;
31 /**
32 * Sorts animation fx by an arbitrary ID
33 * Must be initialized from a .id_to_string_array sheet, which gives the id / sheet_name pairs
34 * The sheet name must be a .animation_fx one
36 * \author Nicolas Vizerie
37 * \author Nevrax France
38 * \date 2003
40 class CAnimationFXIDArray
42 public:
43 // ctor
44 CAnimationFXIDArray();
45 /** init from a .id_to_string_array sheet
46 * animation set is required to build fxs tracks.
47 * \param mustDeleteAnimSet true if ownerShip of animset must be given to that object (e.g it is deleted by that object at release())
49 void init(const CIDToStringArraySheet &sheet, NL3D::UAnimationSet *animSet, bool mustDeleteAnimSet = false);
50 /** init from a .id_to_string_array sheet name
51 * animation set is required to build fxs tracks.
52 * \param mustDeleteAnimSet true if ownerShip of animset must be given to that object (e.g it is deleted by that object at release())
54 void init(const std::string &sheetName, NL3D::UAnimationSet *animSet, bool mustDeleteAnimSet = false);
55 // release data from that object
56 void release();
57 // retrieve a fx from its id, or NULL if not known
58 const CAnimationFX *getFX(uint32 id) const;
59 private:
60 struct CIDToFX
62 uint32 ID;
63 CAnimationFX FX;
64 bool operator < (const CIDToFX &rhs) const { return this->ID < rhs.ID; }
66 std::vector<CIDToFX> _IDToFXArray;
67 NL3D::UAnimationSet *_AnimSet;
72 #endif