Ejemplo n.º 1
0
void TechnoType::loadRules(INIFile* rules)
{
	ObjectType::loadRules(rules);
	INISection* rulesSection = rules->getSection(ID);

	loadWeaponTypes(rulesSection);

	rulesSection->readStringValue("Dock", Dock);
	rulesSection->readStringValue("DeploysInto", DeploysInto);
	rulesSection->readStringValue("UndeploysInto", UndeploysInto);
	rulesSection->readStringValue("PowersUnit", PowersUnit);
	rulesSection->readStringValue("Explosion", Explosion);
	rulesSection->readStringValue("DestroyAnim", DestroyAnim);
	rulesSection->readStringValue("AirstrikeTeamType", AirstrikeTeamType);
	rulesSection->readStringValue("EliteAirstrikeTeamType", EliteAirstrikeTeamType);
	rulesSection->readStringValue("UnloadingClass", UnloadingClass);
	rulesSection->readStringValue("DeployingAnim", DeployingAnim);
	rulesSection->readStringValue("Enslaves", Enslaves);
	rulesSection->readStringValue("Spawns", Spawns);

	allocateList(BuildingType::Array, Dock);
	BuildingType::Array.findOrAllocate(DeploysInto);
	VehicleType::Array.findOrAllocate(UndeploysInto);
	VehicleType::Array.findOrAllocate(PowersUnit);


	allocateList(Animation::Array, Explosion);
	allocateList(Animation::Array, DestroyAnim);
	AircraftType::Array.findOrAllocate(AirstrikeTeamType);
	AircraftType::Array.findOrAllocate(EliteAirstrikeTeamType);
	VehicleType::Array.findOrAllocate(UnloadingClass);
	Animation::Array.findOrAllocate(DeployingAnim);
	InfantryType::Array.findOrAllocate(Enslaves);
	AircraftType::Array.findOrAllocate(Spawns);

	 rulesSection->readBoolValue("Turret", Turret);

	rulesSection->readBoolValue("IsTrain", IsTrain);
	rulesSection->readIntValue("Passengers", Passengers);
	rulesSection->readFloatValue("Size", Size);
	rulesSection->readFloatValue("SizeLimit", SizeLimit);

	rulesSection->readIntValue("TechLevel", TechLevel);
	rulesSection->readIntValue("AIBasePlanningSide", AIBasePlanningSide);

	rulesSection->readBoolValue("NoShadow", NoShadow);
	rulesSection->readIntValue("ZFudgeCliff", ZFudgeCliff);
	rulesSection->readIntValue("ZFudgeColumn", ZFudgeColumn);
	rulesSection->readIntValue("ZFudgeTunnel", ZFudgeTunnel);
	rulesSection->readIntValue("ZFudgeBridge", ZFudgeBridge);
}
Ejemplo n.º 2
0
int *generateList(int n, int noinit)
{
    int *list, i;
    list=allocateList(n);
    if (!noinit) {
        for (i=0; i<n; i++) {
            list[i] = i;
        }
    }
    return list;
}