MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Load

Method Load

engine/Poseidon/World/Simulation/Simul.cpp:162–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162void EntityType::Load(const ParamEntry& par)
163{
164 _accuracy = 1.0;
165
166 _className = par.GetName();
167 _simName = par >> "simulation";
168
169 RString model = par >> "model";
170 _shapeName = ::GetShapeName(model);
171
172 _shapeReversed = false;
173 _shapeAutoCentered = true;
174 _shapeAnimated = true;
175 _useRoadwayForVehicles = false;
176
177 if (par.FindEntry("reversed"))
178 {
179 _shapeReversed = par >> "reversed";
180 }
181 if (par.FindEntry("autocenter"))
182 {
183 _shapeAutoCentered = par >> "autocenter";
184 }
185 if (par.FindEntry("animated"))
186 {
187 _shapeAnimated = par >> "animated";
188 }
189 if (par.FindEntry("useRoadwayForVehicles"))
190 {
191 _useRoadwayForVehicles = par >> "useRoadwayForVehicles";
192 }
193
194 const ParamClass* cls = dynamic_cast<const ParamClass*>(&par);
195 if (cls)
196 {
197 const char* baseName = cls->GetBaseName();
198 if (baseName)
199 {
200 _parentType = VehicleTypes.New(baseName);
201 }
202 }
203}
204
205EntityType::~EntityType()
206{

Callers

nothing calls this directly

Calls 4

GetShapeNameFunction · 0.85
GetNameMethod · 0.45
FindEntryMethod · 0.45
NewMethod · 0.45

Tested by

no test coverage detected