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/>.
17 #include "formFlora.h"
19 #include "nel/misc/common.h"
20 #include "nel/misc/debug.h"
22 #include "nel/georges/u_form_elm.h"
25 using namespace NLMISC
;
26 using namespace NLGEORGES
;
28 // ---------------------------------------------------------------------------
29 void SFormFlora::build (UFormElm
&item
)
31 IncludePatats
.clear ();
32 ExcludePatats
.clear ();
33 PlantInstances
.clear ();
35 // Read the Include_patats field
37 if (item
.getNodeByName (&pElt
, "Include_patats") && pElt
)
40 nlverify (pElt
->getArraySize (size
));
41 for (uint i
=0; i
<size
; i
++)
44 pElt
->getArrayValue (value
, i
);
45 IncludePatats
.push_back (value
);
49 // Read the Include_patats field
50 if (item
.getNodeByName (&pElt
, "Exclude_patats") && pElt
)
53 nlverify (pElt
->getArraySize (size
));
54 for (uint i
=0; i
<size
; i
++)
57 pElt
->getArrayValue (value
, i
);
58 ExcludePatats
.push_back (value
);
62 // Read the Plants field
63 if (item
.getNodeByName (&pElt
, "Plants") && pElt
)
66 nlverify (pElt
->getArraySize (size
));
67 for (uint i
=0; i
<size
; i
++)
71 if (pElt
->getArrayNode (&pArrayElt
, i
) && pArrayElt
)
74 pArrayElt
->getValueByName (piTmp
.Name
, "File name");
75 pArrayElt
->getValueByName (piTmp
.Density
, "Density");
76 pArrayElt
->getValueByName (piTmp
.Falloff
, "Falloff");
77 PlantInstances
.push_back (piTmp
);
82 item
.getValueByName (JitterPos
, "Jitter_Pos");
84 item
.getValueByName (ScaleMin
, "Scale_Min");
86 item
.getValueByName (ScaleMax
, "Scale_Max");
88 item
.getValueByName (PutOnWater
, "Put_On_Water");
90 item
.getValueByName (WaterHeight
, "Water_Height");
92 item
.getValueByName (RandomSeed
, "Random_Seed");