EffectPtr DisplayDeviceOpenGL::createEffect(const variant& node) { ASSERT_LOG(node.has_key("type") && node["type"].is_string(), "Effects must have 'type' attribute as string: " << node.to_debug_string()); const std::string& type = node["type"].as_string(); if(type == "stipple") { return std::make_shared<OpenGL::StippleEffect>(node); } // XXX Add more effects here as and if needed. return EffectPtr(); }
void ProtocolGame::parseMagicEffect(InputMessage& msg) { Position pos = parsePosition(msg); int effectId = msg.getU8(); EffectPtr effect = EffectPtr(new Effect()); effect->setId(effectId); g_map.addThing(effect, pos); }