// ===================================================================== // Utility Functions // ===================================================================== private static void PlaceResourceAt(FreeResourceType resourceType, Vector3 position) { // Refer to Player::DestroyPerson. FreeResource resource = FreeResourceManager.inst.GetPrefabFor(resourceType).CreateResource(position, -1); resource.Holder = null; }
public static int GetProductionPowerForResourceInKingdom(FreeResourceType type) { int production = 0; for (int i = 0; i < World.inst.NumLandMasses; i++) { if (Player.inst.LandMassIsAPlayerLandMass(i)) { production += GetProductionPowerForResourceOnLandmass(type, i); } } return(production); }
public static int GetProductionPowerForResourceOnLandmass(FreeResourceType type, int landmassIdx) { int production = 0; ArrayExt <Building> buildings = Player.inst.GetBuildingListForLandMass(landmassIdx); foreach (Building building in buildings.data) { if (building != null) { if (building.Yield != null) { if (building.Yield.Get(type) > 0) { production += (int)(building.Yield.Get(type)); } } } } return(production); }