Fix classique titles display
[ryzomcore.git] / ryzom / client / src / client_sheets / plant_sheet.h
blob88df3e969bc64612121cd3d9778077824754b460
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_PLANT_SHEET_H
20 #define CL_PLANT_SHEET_H
22 #include "game_share/season.h"
23 #include "entity_sheet.h"
25 /**
26 * Class to manage sheet of per season fxs
27 * \author Nicolas Vizerie
28 * \author Nevrax France
29 * \date 2003
31 class CSeasonFXSheet
33 public:
34 enum TMode { AlwaysStarted = 0, UseEndHour, UseDuration, Spawn };
35 public:
36 TMode Mode;
37 std::string FXName;
38 float CycleDuration;
39 float StartHourMin;
40 float StartHourMax;
41 float EndHourMin;
42 float EndHourMax;
43 float MinDuration;
44 float MaxDuration;
45 float UserParamsMin[4];
46 float UserParamsMax[4];
47 bool InheritScale;
48 bool InheritRot;
49 // for Micro-life primitives only : gives min & max angle of landscape normal toward K for which fx can be spawned
50 float AngleMin;
51 float AngleMax;
52 bool DontRotate;
53 bool DontRotateAroundLocalZ;
54 NLMISC::CVector ScaleMin;
55 NLMISC::CVector ScaleMax;
56 bool UniformScale;
57 bool WantScaling;
58 bool AlignOnWater;
59 float ZOffset;
60 public:
61 CSeasonFXSheet()
63 Mode = AlwaysStarted;
64 CycleDuration = 24.f;
65 StartHourMin = 0.f;
66 StartHourMax = 0.f;
67 EndHourMin = 0.f;
68 EndHourMax = 0.f;
69 std::fill(UserParamsMin, UserParamsMin + 4, 0.f);
70 std::fill(UserParamsMax, UserParamsMax + 4, 0.f);
71 MinDuration = 0.f;
72 MaxDuration = 0.f;
73 InheritScale = false;
74 InheritRot = false;
75 AngleMin = 0.f;
76 AngleMax = 70.f;
77 DontRotate = false;
78 DontRotateAroundLocalZ =false;
79 ScaleMin.set(1.f, 1.f, 1.f);
80 ScaleMax.set(1.f, 1.f, 1.f);
81 UniformScale = true;
82 WantScaling = false;
83 AlignOnWater = false;
84 ZOffset = 0.f;
86 /// Build the sheet from an external script.
87 virtual void build(const NLGEORGES::UFormElm &item, NLMISC::CSheetId parentId, const std::string &prefix);
88 /// Serialize sheet into binary data file.
89 virtual void serial(NLMISC::IStream &f);
92 /**
93 * Class to manage plant sheets
94 * \author Nicolas Vizerie
95 * \author Nevrax France
96 * \date 2002
98 class CPlantSheet : public CEntitySheet
100 public:
101 ///\name Object
102 //@{
103 /// ctor
104 CPlantSheet();
105 /// Build the sheet from an external script.
106 virtual void build(const NLGEORGES::UFormElm &item);
107 /// Serialize plant sheet into binary data file.
108 virtual void serial(NLMISC::IStream &f);
109 //@}
111 // Get the shape name of this plant
112 const std::string &getShapeName() const { return _ShapeName; }
113 float getMaxDist() const { return _MaxDist; }
114 float getCoarseMeshDist() const { return _CoarseMeshDist; }
115 // get fx infos for the given season
116 const CSeasonFXSheet &getFXSheet(EGSPD::CSeason::TSeason season) const
118 nlassert(season < EGSPD::CSeason::Invalid);
119 return SeasonFX[season];
121 private:
122 std::string _ShapeName;
123 float _MaxDist;
124 float _CoarseMeshDist;
125 // fx spawned on a given date and season
126 CSeasonFXSheet SeasonFX[EGSPD::CSeason::Invalid];
131 #endif