Documentation ¶
Index ¶
- Constants
- type CatchmentProvider
- type City
- func (city *City) AddBuilding(building buildinglib.Building)
- func (city *City) AllowedBuildings(what buildinglib.Building) []buildinglib.Building
- func (city *City) AllowedUnits(what buildinglib.Building) []units.Unit
- func (city *City) BaseFoodLevel() int
- func (city *City) Citizens() int
- func (city *City) ComputePower() int
- func (city *City) ComputeSubsistenceFarmers() int
- func (city *City) ComputeUnrest(garrison []units.StackUnit) int
- func (city *City) ComputeUpkeep() int
- func (city *City) DoNextTurn(garrison []units.StackUnit) []CityEvent
- func (city *City) FarmerFoodProduction(farmers int) int
- func (city *City) FoodProductionRate() int
- func (city *City) GetBanner() data.BannerType
- func (city *City) GetOutpostHouses() int
- func (city *City) GetSize() CitySize
- func (city *City) GetWeaponBonus() data.WeaponBonus
- func (city *City) GetX() int
- func (city *City) GetY() int
- func (city *City) GoldBank() int
- func (city *City) GoldMarketplace() int
- func (city *City) GoldMerchantsGuild() int
- func (city *City) GoldMinerals() int
- func (city *City) GoldSurplus() int
- func (city *City) GoldTaxation() int
- func (city *City) GoldTradeGoods() int
- func (city *City) GrowOutpost() CityEvent
- func (city *City) HasFortress() bool
- func (city *City) HasSummoningCircle() bool
- func (city *City) MaximumCitySize() int
- func (city *City) NonRebels() int
- func (city *City) PopulationGrowthRate() int
- func (city *City) PowerCitizens() int
- func (city *City) PowerMinerals() int
- func (city *City) ProducingString() string
- func (city *City) ProducingTurnsLeft() int
- func (city *City) ProductionFarmers() float32
- func (city *City) ProductionForestersGuild() float32
- func (city *City) ProductionMechaniciansGuild() float32
- func (city *City) ProductionMinersGuild() float32
- func (city *City) ProductionSawmill() float32
- func (city *City) ProductionTerrain() float32
- func (city *City) ProductionWorkers() float32
- func (city *City) RequiredFood() int
- func (city *City) ResearchProduction() int
- func (city *City) ResetCitizens(garrison []units.StackUnit)
- func (city *City) SurplusFood() int
- func (city *City) UpdateTaxRate(taxRate fraction.Fraction, garrison []units.StackUnit)
- func (city *City) UpdateUnrest(garrison []units.StackUnit)
- func (city *City) WorkProductionRate() float32
- type CityEvent
- type CityEventNewBuilding
- type CityEventNewUnit
- type CityEventOutpostDestroyed
- type CityEventOutpostHamlet
- type CityEventPopulationGrowth
- type CitySize
Constants ¶
View Source
const MAX_CITY_CITIZENS = 25
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CatchmentProvider ¶
type City ¶
type City struct { Population int Farmers int Workers int Rebels int Name string Wall bool Plane data.Plane Race data.Race X int Y int Outpost bool Banner data.BannerType Buildings *set.Set[buildinglib.Building] CatchmentProvider CatchmentProvider TaxRate fraction.Fraction // reset every turn, keeps track of whether the player sold a building SoldBuilding bool // how many hammers the city has produced towards the current project Production float32 ProducingBuilding buildinglib.Building ProducingUnit units.Unit BuildingInfo buildinglib.BuildingInfos }
func MakeCity ¶
func MakeCity(name string, x int, y int, race data.Race, banner data.BannerType, taxRate fraction.Fraction, buildingInfo buildinglib.BuildingInfos, catchmentProvider CatchmentProvider) *City
func (*City) AddBuilding ¶
func (city *City) AddBuilding(building buildinglib.Building)
func (*City) AllowedBuildings ¶
func (city *City) AllowedBuildings(what buildinglib.Building) []buildinglib.Building
func (*City) AllowedUnits ¶
func (city *City) AllowedUnits(what buildinglib.Building) []units.Unit
func (*City) BaseFoodLevel ¶
compute amount of available food on tiles in catchment area
func (*City) ComputePower ¶
power production from buildings and citizens
func (*City) ComputeSubsistenceFarmers ¶
FIXME: take enchantments into account * https://masterofmagic.fandom.com/wiki/Farmer
func (*City) ComputeUpkeep ¶
func (*City) DoNextTurn ¶
do all the stuff needed per turn increase population, add production, add food/money, etc
func (*City) FarmerFoodProduction ¶
func (*City) FoodProductionRate ¶
func (*City) GetBanner ¶
func (city *City) GetBanner() data.BannerType
func (*City) GetOutpostHouses ¶
func (*City) GetWeaponBonus ¶
func (city *City) GetWeaponBonus() data.WeaponBonus
if the city contains an alchemist's guild then new units get one of the following bonuses
- magic weapon
- mythril weapon (if mythril ore in catchment area)
- adamantium weapon (if adamantium ore in catchment area)
func (*City) GoldMarketplace ¶
func (*City) GoldMerchantsGuild ¶
func (*City) GoldMinerals ¶
func (*City) GoldSurplus ¶
func (*City) GoldTaxation ¶
func (*City) GoldTradeGoods ¶
func (*City) GrowOutpost ¶
func (*City) HasFortress ¶
func (*City) HasSummoningCircle ¶
func (*City) MaximumCitySize ¶
returns the maximum number of citizens. population is citizens * 1000
func (*City) PopulationGrowthRate ¶
func (*City) PowerCitizens ¶
func (*City) PowerMinerals ¶
func (*City) ProducingString ¶
func (*City) ProducingTurnsLeft ¶
func (*City) ProductionFarmers ¶
func (*City) ProductionForestersGuild ¶
func (*City) ProductionMechaniciansGuild ¶
func (*City) ProductionMinersGuild ¶
func (*City) ProductionSawmill ¶
func (*City) ProductionTerrain ¶
func (*City) ProductionWorkers ¶
func (*City) RequiredFood ¶
amount of food needed to feed the citizens
func (*City) ResearchProduction ¶
func (*City) ResetCitizens ¶
func (*City) SurplusFood ¶
func (*City) UpdateTaxRate ¶
func (*City) UpdateUnrest ¶
func (*City) WorkProductionRate ¶
type CityEventNewBuilding ¶
type CityEventNewBuilding struct {
Building buildinglib.Building
}
type CityEventNewUnit ¶
type CityEventNewUnit struct { Unit units.Unit WeaponBonus data.WeaponBonus }
type CityEventOutpostDestroyed ¶
type CityEventOutpostDestroyed struct { }
type CityEventOutpostHamlet ¶
type CityEventOutpostHamlet struct { }
type CityEventPopulationGrowth ¶
type CityEventPopulationGrowth struct {
Size int
}
Click to show internal directories.
Click to hide internal directories.