1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
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.
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"
26 * Class to manage sheet of per season fxs
27 * \author Nicolas Vizerie
28 * \author Nevrax France
34 enum TMode
{ AlwaysStarted
= 0, UseEndHour
, UseDuration
, Spawn
};
45 float UserParamsMin
[4];
46 float UserParamsMax
[4];
49 // for Micro-life primitives only : gives min & max angle of landscape normal toward K for which fx can be spawned
53 bool DontRotateAroundLocalZ
;
54 NLMISC::CVector ScaleMin
;
55 NLMISC::CVector ScaleMax
;
69 std::fill(UserParamsMin
, UserParamsMin
+ 4, 0.f
);
70 std::fill(UserParamsMax
, UserParamsMax
+ 4, 0.f
);
78 DontRotateAroundLocalZ
=false;
79 ScaleMin
.set(1.f
, 1.f
, 1.f
);
80 ScaleMax
.set(1.f
, 1.f
, 1.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
);
93 * Class to manage plant sheets
94 * \author Nicolas Vizerie
95 * \author Nevrax France
98 class CPlantSheet
: public CEntitySheet
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
);
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
];
122 std::string _ShapeName
;
124 float _CoarseMeshDist
;
125 // fx spawned on a given date and season
126 CSeasonFXSheet SeasonFX
[EGSPD::CSeason::Invalid
];