TDME2  1.9.200
SceneEntity.cpp
Go to the documentation of this file.
2 
3 #include <string>
4 
5 #include <tdme/tdme.h>
10 
11 using std::string;
12 
18 
19 SceneEntity::SceneEntity(const string& id, const string& description, const Transform& transform, Prototype* prototype): BaseProperties(id, description)
20 {
21  this->transform.setTransform(transform);
22  this->prototype = prototype;
23 }
24 
26 }
27 
29 {
30  auto totalProperties = new BaseProperties(name, description);
31  for (auto prototypeProperty: getPrototype()->getProperties()) {
32  totalProperties->addProperty(prototypeProperty->getName(), prototypeProperty->getValue());
33  }
34  for (auto entityProperty: getProperties()) {
35  auto totalProperty = totalProperties->getProperty(entityProperty->getName());
36  if (totalProperty != nullptr) {
37  totalProperties->updateProperty(totalProperty->getName(), entityProperty->getName(), entityProperty->getValue());
38  } else {
39  totalProperties->addProperty(entityProperty->getName(), entityProperty->getValue());
40  }
41  }
42  return totalProperties;
43 }
Transform which contain scale, rotations and translation.
Definition: Transform.h:29
virtual void setTransform(const Transform &transform)
Set transform.
Definition: Transform.h:177
BaseProperties(const string &name, const string &description)
Public constructor.
ConstUniquePtrSequenceIterator< BaseProperty > getProperties() const
Base property model class.
Definition: BaseProperty.h:15
Prototype definition.
Definition: Prototype.h:55
Scene entity definition.
Definition: SceneEntity.h:23
const BaseProperties * getTotalProperties()
Definition: SceneEntity.cpp:28