Resolve "Toggle Free Look with Hotkey"
[ryzomcore.git] / ryzom / server / src / gpm_service / sheets.h
blobd2bfdc9383b6649f4e4a66b8809877d1fc0e2546
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
6 //
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #ifndef RY_CMS_SHEETS_H
23 #define RY_CMS_SHEETS_H
25 #include "nel/misc/types_nl.h"
26 #include "nel/misc/smart_ptr.h"
27 #include "nel/misc/sheet_id.h"
29 ///Nel Georges
30 #include "nel/georges/u_form.h"
31 #include "nel/georges/u_form_elm.h"
34 /**
35 * Singleton containing database on information for actors
36 * \author Sadge
37 * \author Nevrax France
38 * \date 2002
40 class CGpmSheets
42 public:
43 class CSheet
45 public:
46 CSheet(): WalkSpeed(1.3f), RunSpeed(6.0f), Radius(0.5f), Height(2.0f), BoundingRadius(0.5), Scale(1.0f) {}
48 float WalkSpeed;
49 float RunSpeed;
50 float Radius; // pacs primitive's radius
51 float Height; // pacs primitive's height
52 float BoundingRadius; // fighting radius
53 float Scale; // entity scale
55 void readGeorges (const NLMISC::CSmartPtr<NLGEORGES::UForm> &form, const NLMISC::CSheetId &sheetId)
57 // the form was found so read the true values from George
58 form->getRootNode ().getValueByName (WalkSpeed, "Basics.MovementSpeeds.WalkSpeed");
59 form->getRootNode ().getValueByName (RunSpeed, "Basics.MovementSpeeds.RunSpeed");
60 form->getRootNode ().getValueByName (Radius, "Collision.CollisionRadius");
61 form->getRootNode ().getValueByName (Height, "Collision.Height");
62 form->getRootNode ().getValueByName (BoundingRadius, "Collision.BoundingRadius");
63 form->getRootNode ().getValueByName (Scale, "3d data.Scale");
66 void serial (NLMISC::IStream &s)
68 s.serial (WalkSpeed, RunSpeed, Radius, Height, BoundingRadius, Scale);
71 static uint getVersion () { return 1; }
73 void removed() {}
76 // load the creature data from the george files
77 static void init();
79 // display the creature data for all known creature types
80 static void display();
83 static void release() {}
86 // get a data record from the database
87 static const CSheet *lookup( NLMISC::CSheetId id );
89 private:
90 // prohibit cnstructor as this is a singleton
91 CGpmSheets();
93 static std::map<NLMISC::CSheetId,CSheet> _sheets;
94 static bool _initialised;
98 #endif // RY_CMS_SHEETS_H