コード例 #1
0
void ComponentExitMapOnUse::load(const PropertyBag &data)
{
	resetMembers();
	nextMap = data.getFileName("nextMap");
	sfxOnFail = data.getFileName("sfxOnFailed");
	requiresCoins = data.getBool("requiresCoins");
}
コード例 #2
0
ファイル: ComponentHealth.cpp プロジェクト: foxostro/heroman
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
}
コード例 #3
0
ファイル: ParticleSystem.cpp プロジェクト: foxostro/heroman
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");
}
コード例 #4
0
void ComponentUseOnCollision::load(const PropertyBag &data) {
	resetMembers();
	onlyPlayers = data.getBool("onlyPlayers");
}