Documentation
¶
Index ¶
Constants ¶
View Source
const ( KindBuilding string = "building" KindResource string = "resource" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Building ¶
type Building struct { ID uuid.UUID `json:"id" yaml:"id"` Name BuildingName `json:"name" yaml:"name"` InitialAmount int `json:"initial_amount" yaml:"initial_amount"` WorkersMaximum int `json:"workers_maximum" yaml:"workers_maximum"` Cost []ResourceCost `json:"cost" yaml:"cost"` Generates []Generator `json:"generates" yaml:"generates"` Transforms []Transformer `json:"transforms" yaml:"transforms"` Stores map[ResourceName]int `json:"stores" yaml:"stores"` BuildTime string `json:"build_time" yaml:"build_time"` Version int `json:"version" yaml:"version"` }
func (*Building) GetVersion ¶
type BuildingName ¶
type BuildingName string
const ( House BuildingName = "house" Warehouse BuildingName = "warehouse" Woodcutter BuildingName = "woodcutter" Lumberyard BuildingName = "lumberyard" )
func (BuildingName) String ¶
func (r BuildingName) String() string
type Generator ¶
type Generator struct { Name ResourceName `json:"name" yaml:"name"` Amount int `json:"amount" yaml:"amount"` TickLength string `json:"tick_length" yaml:"tick_length"` }
type Resource ¶
type Resource struct { Name ResourceName `json:"name" yaml:"name"` StartingAmount int `json:"starting_amount" yaml:"starting_amount"` StartingCap int `json:"starting_cap" yaml:"starting_cap"` CapFormula string `json:"cap_formula" yaml:"cap_formula"` Version int `json:"version" yaml:"version"` }
func (*Resource) GetVersion ¶
type ResourceCost ¶
type ResourceCost struct { Resource ResourceName Amount int Permanent bool }
type ResourceName ¶
type ResourceName string
const ( Population ResourceName = "Population" Wood ResourceName = "Wood" Stone ResourceName = "Stone" Planks ResourceName = "Planks" )
func (ResourceName) String ¶
func (r ResourceName) String() string
type Transformer ¶
type Transformer struct { Name string `json:"name" yaml:"name"` Cost []TransformerCost `json:"cost" yaml:"cost"` Result []TransformerResult `json:"result" yaml:"result"` TickLength string `json:"tick_length" yaml:"tick_length"` }
func (Transformer) CostStructList ¶
func (t Transformer) CostStructList() *structpb.ListValue
func (Transformer) ResultStructList ¶
func (t Transformer) ResultStructList() *structpb.ListValue
type TransformerCost ¶
type TransformerCost struct { Resource ResourceName `json:"resource" yaml:"resource"` Amount int `json:"amount" yaml:"amount"` Temporary bool `json:"is_temporary" yaml:"is_temporary"` }
type TransformerResult ¶
type TransformerResult struct { Resource ResourceName `json:"resource" yaml:"resource"` Amount int `json:"amount" yaml:"amount"` }
Click to show internal directories.
Click to hide internal directories.