void ComponentExitMapOnUse::load(const PropertyBag &data) { resetMembers(); nextMap = data.getFileName("nextMap"); sfxOnFail = data.getFileName("sfxOnFailed"); requiresCoins = data.getBool("requiresCoins"); }
void ComponentHealth::load(const PropertyBag &data) { resetMembers(); health = data.getInt("health"); maxHealth = data.getInt("maxHealth"); damageToPowerRatio = data.getFloat("damageToPowerRatio"); willResurrectAfterCountDown = data.getBool("willResurrectAfterCountDown"); timeUntilResurrection = data.getFloat("timeUntilResurrection"); data.get("displayPower", displayPower); // optional tag }
void ParticleSystem::loadParticleMaterials(const PropertyBag &data, TextureFactory &textureFactory) { const size_t nMaterials = data.getNumInstances("material"); ASSERT(nMaterials>0, "particle system does not specify any materials"); for(size_t i=0; i<nMaterials; ++i) { PropertyBag MatBag = data.getBag("material", i); Material material; const string name = MatBag.getString("name"); const FileName fileName = MatBag.getString("image"); material.setTexture(textureFactory.load(fileName, false)); material.glow = MatBag.getBool("glow"); materials.insert(make_pair(name, material)); } ASSERT(!materials.empty(), "after loading, there are no particle materials in system"); }
void ComponentUseOnCollision::load(const PropertyBag &data) { resetMembers(); onlyPlayers = data.getBool("onlyPlayers"); }