Item::Item(const ItemAttributes& attr) : Renderable(ViewObject(*attr.viewId, ViewLayer::ITEM, capitalFirst(*attr.name))), attributes(attr), fire(attr.burnTime), canEquipCache(!!attributes->equipmentSlot), classCache(*attributes->itemClass) { if (!attributes->prefixes.empty()) modViewObject().setModifier(ViewObject::Modifier::AURA); modViewObject().setGenericId(getUniqueId().getGenericId()); }
const ViewObject& Trigger::getTorchViewObject(Dir dir) { static map<Dir, ViewObject> objs; if (objs.empty()) for (Dir dir : ENUM_ALL(Dir)) objs[dir] = ViewObject(ViewId::TORCH, dir == Dir::N ? ViewLayer::TORCH1 : ViewLayer::TORCH2, "Torch") .setAttachmentDir(dir); return objs[dir]; }
Item::Item(const ItemAttributes& attr) : Renderable(ViewObject(*attr.viewId, ViewLayer::ITEM, *attr.name)), attributes(attr), fire(*attr.weight, attr.flamability) { }
ViewObject CreatureAttributes::createViewObject() const { return ViewObject(*viewId, ViewLayer::CREATURE, name->bare()); }