Documentation
¶
Index ¶
- type Assembler
- func (a *Assembler) CraftingSpeed() float64
- func (a *Assembler) DoCraft() CraftStatus
- func (a *Assembler) EnergySource() data.EnergySource
- func (a *Assembler) EnergyUsage() float64
- func (a *Assembler) Inventory(slot constants.Inventory) Inventory
- func (a *Assembler) Name() string
- func (a *Assembler) ProductivityBonus(recipe string) float64
- func (a *Assembler) PutModules(modules []string) error
- func (a *Assembler) Recipe() *data.Recipe
- func (a *Assembler) SetRecipe(recipe *data.Recipe) map[string]int
- func (a *Assembler) Slots() *slots
- func (a *Assembler) Status() CraftStatus
- func (a *Assembler) TakeModules(modules []string) error
- type Boiler
- type Building
- type CraftStatus
- type CraftingBuilding
- type ErrForbiddenModules
- type ErrNotEnoughModules
- type ErrTooManyModules
- type Furnace
- func (f *Furnace) CraftingSpeed() float64
- func (f *Furnace) DoCraft() CraftStatus
- func (f *Furnace) EnergySource() data.EnergySource
- func (f *Furnace) EnergyUsage() float64
- func (f *Furnace) Inventory(slot constants.Inventory) Inventory
- func (f *Furnace) Name() string
- func (f *Furnace) ProductivityBonus(recipe string) float64
- func (f *Furnace) PutModules(modules []string) error
- func (f *Furnace) Recipe() *data.Recipe
- func (f *Furnace) Slots() *slots
- func (f *Furnace) Status() CraftStatus
- func (f *Furnace) TakeModules(modules []string) error
- type Inventory
- type Lab
- type Modules
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assembler ¶
type Assembler struct { Entity *data.AssemblingMachine // contains filtered or unexported fields }
func NewAssembler ¶
func NewAssembler(spec *data.AssemblingMachine) *Assembler
func (*Assembler) CraftingSpeed ¶
func (*Assembler) DoCraft ¶
func (a *Assembler) DoCraft() CraftStatus
func (*Assembler) EnergySource ¶
func (a *Assembler) EnergySource() data.EnergySource
func (*Assembler) EnergyUsage ¶
func (*Assembler) ProductivityBonus ¶
func (*Assembler) PutModules ¶
func (*Assembler) Status ¶
func (a *Assembler) Status() CraftStatus
func (*Assembler) TakeModules ¶
type Boiler ¶
func (*Boiler) ProductivityBonus ¶
func (*Boiler) PutModules ¶
func (*Boiler) TakeModules ¶
type CraftStatus ¶
type CraftStatus byte
const ( CraftStatusNoRecipe CraftStatus = iota CraftStatusRunning CraftStatusWaitingForInput CraftStatusOutputBlocked )
type CraftingBuilding ¶
type CraftingBuilding interface { Building EnergySource() data.EnergySource EnergyUsage() float64 CraftingSpeed() float64 // the current recipe that's set or (for furnaces) computed based on the input Recipe() *data.Recipe // Current status of the machine. Crafting is simplified and assumed to be instant // as long as the ingredients are present and there's space to put the products Status() CraftStatus // applies one crafting cycle, accounting for inventory limitations and // module bonuses, and returns the status of the machine DoCraft() CraftStatus }
type ErrForbiddenModules ¶
type ErrForbiddenModules struct {
// contains filtered or unexported fields
}
func (ErrForbiddenModules) Error ¶
func (e ErrForbiddenModules) Error() string
type ErrNotEnoughModules ¶
type ErrNotEnoughModules struct {
// contains filtered or unexported fields
}
func (ErrNotEnoughModules) Error ¶
func (e ErrNotEnoughModules) Error() string
type ErrTooManyModules ¶
type ErrTooManyModules struct {
// contains filtered or unexported fields
}
func (ErrTooManyModules) Error ¶
func (e ErrTooManyModules) Error() string
type Furnace ¶
func NewFurnace ¶
func (*Furnace) CraftingSpeed ¶
func (*Furnace) DoCraft ¶
func (f *Furnace) DoCraft() CraftStatus
func (*Furnace) EnergySource ¶
func (f *Furnace) EnergySource() data.EnergySource
func (*Furnace) EnergyUsage ¶
func (*Furnace) ProductivityBonus ¶
func (*Furnace) PutModules ¶
func (*Furnace) Status ¶
func (f *Furnace) Status() CraftStatus
func (*Furnace) TakeModules ¶
type Modules ¶
type Modules struct {
// contains filtered or unexported fields
}
func (Modules) ProductivityBonus ¶
Click to show internal directories.
Click to hide internal directories.