MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / SetFromDesc

Method SetFromDesc

Source/Objects/group.cpp:104–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104bool Group::SetFromDesc(const EntityDescription& desc) {
105 bool ret = Object::SetFromDesc(desc);
106 if (ret) {
107 for (auto new_desc : desc.children) {
108 Object* obj = CreateObjectFromDesc(new_desc);
109 if (obj) {
110 obj->SetParent(this);
111 children.resize(children.size() + 1);
112 children.back().direct_ptr = obj;
113 } else {
114 LOGE << "Failed constructing child to Group" << std::endl;
115 }
116 }
117 const EntityDescriptionField* version_edf = desc.GetField(EDF_VERSION);
118 if (!version_edf) {
119 InitShape();
120 }
121
122 InitRelMats();
123 }
124 return ret;
125}
126
127void Group::GetDesc(EntityDescription& desc) const {
128 Object::GetDesc(desc);

Callers 1

CreateObjectFromDescFunction · 0.45

Calls 6

CreateObjectFromDescFunction · 0.85
GetFieldMethod · 0.80
SetParentMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected