void AircraftType::loadRules(INIFile* rules) { INISection* rulesSection = rules->getSection(ID); if (!rulesSection) return; TechnoType::loadRules(rules); rulesSection->readBoolValue("Fighter", Fighter, Fighter); rulesSection->readBoolValue("CarryAll", CarryAll, CarryAll); }
void VehicleType::loadRules(INIFile* rules) { INISection* rulesSection = rules->getSection(ID); if (!rulesSection) return; TechnoType::loadRules(rules); rulesSection->readBoolValue("Harvester", Harvester); rulesSection->readBoolValue("Weeder", Weeder); rulesSection->readBoolValue("UseTurretShadow", UseTurretShadow); }
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); }
void InfantryType::loadRules(INIFile* rules) { INISection* rulesSection = rules->getSection(ID); if (!rulesSection) return; TechnoType::loadRules(rules); rulesSection->readStringValue("OccupyWeapon", OccupyWeapon); rulesSection->readStringValue("EliteOccupyWeapon", EliteOccupyWeapon); WeaponType::Array.findOrAllocate(OccupyWeapon); WeaponType::Array.findOrAllocate(EliteOccupyWeapon); rulesSection->readBoolValue("Cyborg", Cyborg); rulesSection->readBoolValue("NotHuman", NotHuman); rulesSection->readBoolValue("Occupier", Occupier); rulesSection->readBoolValue("Civilian", Civilian); }
void TechnoType::loadArt(INIFile* art) { ObjectType::loadArt(art); INISection* artSection = art->getSection(ID); artSection->readBoolValue("Remapable", Remapable); artSection->readStringValue("Palette", Palette); artSection->readStringValue("TurretOffset", TurretOffsetStr); LineSplitter split(TurretOffsetStr); TurretOffset.x = split.pop_int(); TurretOffset.y = split.pop_int(); TurretOffset.z = split.pop_int(); }
void House::parse(INIFile* file) { INISection* houseSection = file->getSection(ID); if (!houseSection) return; houseSection->readStringValue("Country", Country); houseSection->readIntValue("TechLevel", TechLevel); houseSection->readIntValue("Credits", Credits); houseSection->readIntValue("IQ", IQ); houseSection->readStringValue("Edge", Edge); houseSection->readBoolValue("PlayerControl", PlayerControl); houseSection->readStringValue("Color", Color); houseSection->readIntValue("PercentBuilt", PercentBuilt); houseSection->readIntValue("NodeCount", NodeCount); std::string allies_List; houseSection->readStringValue("Allies", allies_List); loadAllies(allies_List); loadNodes(houseSection); }
void BuildingType::loadArt(INIFile* art) { INISection* artSection = art->getSection(ID); if (!artSection) return; TechnoType::loadArt(art); artSection->readIntValue("Height", Height); artSection->readIntValue("OccupyHeight", OccupyHeight); artSection->readStringValue("ToOverlay", ToOverlay); OverlayType::Array.findOrAllocate(ToOverlay); Foundation; //TODO: implement foundations artSection->readBoolValue("TerrainPalette", TerrainPalette); //Active Anim1 artSection->readStringValue("ActiveAnim", ActiveAnim); artSection->readStringValue("ActiveAnimDamaged", ActiveAnimDamaged); artSection->readIntValue("ActiveAnimX", ActiveAnimX); artSection->readIntValue("ActiveAnimY", ActiveAnimY); artSection->readIntValue("ActiveAnimZAdjust", ActiveAnimZAdjust); artSection->readIntValue("ActiveAnimYSort", ActiveAnimYSort); artSection->readBoolValue("ActiveAnimPowered", ActiveAnimPowered); artSection->readBoolValue("ActiveAnimPoweredLight", ActiveAnimPoweredLight); artSection->readBoolValue("ActiveAnimPoweredSpecial", ActiveAnimPoweredSpecial); //Active Anim2 artSection->readStringValue("ActiveAnimTwo", ActiveAnimTwo); artSection->readStringValue("ActiveAnimTwoDamaged", ActiveAnimTwoDamaged); artSection->readIntValue("ActiveAnimTwoX", ActiveAnimTwoX); artSection->readIntValue("ActiveAnimTwoY", ActiveAnimTwoY); artSection->readIntValue("ActiveAnimTwoZAdjust", ActiveAnimTwoZAdjust); artSection->readIntValue("ActiveAnimTwoYSort", ActiveAnimTwoYSort); artSection->readBoolValue("ActiveAnimTwoPowered", ActiveAnimTwoPowered); artSection->readBoolValue("ActiveAnimTwoPoweredLight", ActiveAnimTwoPoweredLight); artSection->readBoolValue("ActiveAnimTwoPoweredSpecial", ActiveAnimTwoPoweredSpecial); //Active Anim3 artSection->readStringValue("ActiveAnimThree", ActiveAnimThree); artSection->readStringValue("ActiveAnimThreeDamaged", ActiveAnimThreeDamaged); artSection->readIntValue("ActiveAnimThreeX", ActiveAnimThreeX); artSection->readIntValue("ActiveAnimThreeY", ActiveAnimThreeY); artSection->readIntValue("ActiveAnimThreeZAdjust", ActiveAnimThreeZAdjust); artSection->readIntValue("ActiveAnimThreeYSort", ActiveAnimThreeYSort); artSection->readBoolValue("ActiveAnimThreePowered", ActiveAnimThreePowered); artSection->readBoolValue("ActiveAnimThreePoweredLight", ActiveAnimThreePoweredLight); artSection->readBoolValue("ActiveAnimThreePoweredSpecial", ActiveAnimThreePoweredSpecial); //Active Anim4 artSection->readStringValue("ActiveAnimFour", ActiveAnimFour); artSection->readStringValue("ActiveAnimFourDamaged", ActiveAnimFourDamaged); artSection->readIntValue("ActiveAnimFourX", ActiveAnimFourX); artSection->readIntValue("ActiveAnimFourY", ActiveAnimFourY); artSection->readIntValue("ActiveAnimFourZAdjust", ActiveAnimFourZAdjust); artSection->readIntValue("ActiveAnimFourYSort", ActiveAnimFourYSort); artSection->readBoolValue("ActiveAnimFourPowered", ActiveAnimFourPowered); artSection->readBoolValue("ActiveAnimFourPoweredLight", ActiveAnimFourPoweredLight); artSection->readBoolValue("ActiveAnimFourPoweredSpecial", ActiveAnimFourPoweredSpecial); //Special Anims 1-4 //TODO: Rework in class? //Concept is simple: sizes are all the same and bound to 'Upgrades' key //PowerUpAnims; //PowerUpDamagedAnims; //PowerUpLocXXs; //PowerUpLocYYs; //PowerUpLocZZs; //PowerUpXYSorts; artSection->readStringValue("Rubble", Rubble); artSection->readStringValue("BibShape", BibShape); artSection->readStringValue("Image", ArtImage); }
void BuildingType::loadRules(INIFile* rules) { INISection* rulesSection = rules->getSection(ID); if (!rulesSection) return; TechnoType::loadRules(rules); rulesSection->readStringValue("ToTile", ToTile, ToTile); rulesSection->readBoolValue("HasSpotlight", HasSpotlight, HasSpotlight); rulesSection->readStringValue("HalfDamageSmokeLocation1", HalfDamageSmokeLocation1_str, HalfDamageSmokeLocation1_str); LineSplitter split(HalfDamageSmokeLocation1_str); HalfDamageSmokeLocation1.x = split.pop_int(); HalfDamageSmokeLocation1.y = split.pop_int(); HalfDamageSmokeLocation1.z = split.pop_int(); rulesSection->readStringValue("HalfDamageSmokeLocation2", HalfDamageSmokeLocation2_str, HalfDamageSmokeLocation2_str); LineSplitter split2(HalfDamageSmokeLocation2_str); HalfDamageSmokeLocation2.x = split2.pop_int(); HalfDamageSmokeLocation2.y = split2.pop_int(); HalfDamageSmokeLocation2.z = split2.pop_int(); rulesSection->readBoolValue("WaterBound", WaterBound, WaterBound); rulesSection->readBoolValue("Powered", Powered, Powered); rulesSection->readIntValue("RefinerySmokeFrames", RefinerySmokeFrames, RefinerySmokeFrames); rulesSection->readBoolValue("Wall", Wall, Wall); VehicleType::Array.findOrAllocate(FreeUnit); rulesSection->readBoolValue("IsPlug", IsPlug); InfantryType::Array.findOrAllocate(SecretInfantry); VehicleType::Array.findOrAllocate(SecretUnit); BuildingType::Array.findOrAllocate(SecretBuilding); rulesSection->readBoolValue("Gate", Gate); rulesSection->readBoolValue("LaserFencePost", LaserFencePost); rulesSection->readBoolValue("LaserFence", LaserFence); rulesSection->readBoolValue("FirestormWall", FirestormWall); rulesSection->readStringValue("PowersUpBuilding", PowersUpBuilding); rulesSection->readIntValue("PowersUpToLevel", PowersUpToLevel); rulesSection->readIntValue("Power", Power); rulesSection->readIntValue("ExtraPower", ExtraPower); rulesSection->readStringValue("TurretAnim", TurretAnim); rulesSection->readStringValue("TurretAnimDamaged", TurretAnimDamaged); rulesSection->readStringValue("TurretAnimGarrisoned", TurretAnimGarrisoned); rulesSection->readIntValue("TurretAnimX", TurretAnimX); rulesSection->readIntValue("TurretAnimY", TurretAnimY); rulesSection->readIntValue("TurretAnimZAdjust", TurretAnimZAdjust); rulesSection->readIntValue("TurretAnimYSort", TurretAnimYSort); rulesSection->readBoolValue("TurretAnimPowered", TurretAnimPowered); rulesSection->readBoolValue("TurretAnimPoweredLight", TurretAnimPoweredLight); rulesSection->readBoolValue("TurretAnimPoweredEffect", TurretAnimPoweredEffect); rulesSection->readBoolValue("TurretAnimPoweredSpecial", TurretAnimPoweredSpecial); rulesSection->readBoolValue("TurretAnimIsVoxel", TurretAnimIsVoxel); rulesSection->readStringValue("VoxelBarrelFile", VoxelBarrelFile); rulesSection->readStringValue("VoxelBarrelOffsetToRotatePivotPoint", VoxelBarrelOffsetToRotatePivotPoint_str); LineSplitter split3(VoxelBarrelOffsetToRotatePivotPoint_str); VoxelBarrelOffsetToRotatePivotPoint.x = split3.pop_int(); VoxelBarrelOffsetToRotatePivotPoint.y = split3.pop_int(); VoxelBarrelOffsetToRotatePivotPoint.z = split3.pop_int(); rulesSection->readStringValue("VoxelBarrelOffsetToBuildingPivotPoint", VoxelBarrelOffsetToBuildingPivotPoint_str); LineSplitter split4(VoxelBarrelOffsetToBuildingPivotPoint_str); VoxelBarrelOffsetToBuildingPivotPoint.x = split4.pop_int(); VoxelBarrelOffsetToBuildingPivotPoint.y = split4.pop_int(); VoxelBarrelOffsetToBuildingPivotPoint.z = split4.pop_int(); rulesSection->readStringValue("VoxelBarrelOffsetToPitchPivotPoint", VoxelBarrelOffsetToPitchPivotPoint_str); LineSplitter split5(VoxelBarrelOffsetToPitchPivotPoint_str); VoxelBarrelOffsetToPitchPivotPoint.x = split5.pop_int(); VoxelBarrelOffsetToPitchPivotPoint.y = split5.pop_int(); VoxelBarrelOffsetToPitchPivotPoint.z = split5.pop_int(); rulesSection->readStringValue("VoxelBarrelOffsetToBarrelEnd", VoxelBarrelOffsetToBarrelEnd_str); LineSplitter split6(VoxelBarrelOffsetToBarrelEnd_str); VoxelBarrelOffsetToBarrelEnd.x = split6.pop_int(); VoxelBarrelOffsetToBarrelEnd.y = split6.pop_int(); VoxelBarrelOffsetToBarrelEnd.z = split6.pop_int(); rulesSection->readIntValue("Upgrades", Upgrades, Upgrades); }