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

Method SetFromDesc

Source/Objects/decalobject.cpp:143–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143bool DecalObject::SetFromDesc(const EntityDescription& desc) {
144 bool ret = Object::SetFromDesc(desc);
145 if (ret) {
146 for (const auto& field : desc.fields) {
147 switch (field.type) {
148 case EDF_FILE_PATH: {
149 std::string type_file;
150 field.ReadString(&type_file);
151 if (type_file != obj_file) {
152 Load(type_file);
153 }
154 break;
155 }
156 }
157 }
158 color_tint_component_.SetFromDescription(desc);
159 }
160 return ret;
161}
162
163void DecalObject::Load(const std::string& type_file) {
164 obj_file = type_file;

Callers

nothing calls this directly

Calls 3

SetFromDescriptionMethod · 0.80
LoadFunction · 0.50
ReadStringMethod · 0.45

Tested by

no test coverage detected