structure

package
v0.0.0-...-40e17fa Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StructureDataLength = 13
	StructuresJSONFile  = "structures.json"
)
View Source
const (
	HQ int = iota
	Outpost
	Water
	Habitat
	Settlement
	Mine
	Smelter
	Factory
	Silica
	ChipFoundry
	Assembly
	Colony
	Capitol
)
View Source
const (
	Tax int = iota
	Residential
	Extractor
	Processor
)

Variables

This section is empty.

Functions

func GetStructureData

func GetStructureData() *[StructureDataLength]StructureData

Types

type Consumption

type Consumption struct {
	Resource int
	Rate     uint8
}

type Ingredient

type Ingredient struct {
	Resource int
	Quantity uint8
}

type Production

type Production struct {
	Resource int
	Rate     uint8
	Requires []Ingredient
}

type Storage

type Storage struct {
	Resource int
	Capacity uint8
	Amount   uint8
	Incoming uint8
}

type Structure

type Structure struct {
	Bounds image.Rectangle
	// contains filtered or unexported fields
}

func New

func New(structureType int, sd *StructureData, p *planet.Planet) *Structure

func (*Structure) ActiveWorkers

func (s *Structure) ActiveWorkers() int

func (*Structure) AssignWorkers

func (s *Structure) AssignWorkers(workers int)

func (*Structure) AwaitDelivery

func (s *Structure) AwaitDelivery(resource int)

func (*Structure) CanProduce

func (s *Structure) CanProduce() bool

func (*Structure) Class

func (s *Structure) Class() int

func (*Structure) CollectIncome

func (s *Structure) CollectIncome() int

func (*Structure) Consume

func (s *Structure) Consume(count uint) (bool, int)

func (*Structure) Deprioritize

func (s *Structure) Deprioritize()

func (*Structure) Draw

func (s *Structure) Draw(image *ebiten.Image)

func (*Structure) GenerateIncome

func (s *Structure) GenerateIncome()

func (*Structure) HasShips

func (s *Structure) HasShips() bool

func (*Structure) Highlight

func (s *Structure) Highlight()

func (*Structure) Income

func (s *Structure) Income() int

func (*Structure) IsHighlighted

func (s *Structure) IsHighlighted() bool

func (*Structure) IsPaused

func (s *Structure) IsPaused() bool

func (*Structure) IsPrioritized

func (s *Structure) IsPrioritized() bool

func (*Structure) LaborCost

func (s *Structure) LaborCost() int

func (*Structure) LaunchShip

func (s *Structure) LaunchShip(resource int)

func (*Structure) MouseButton

func (s *Structure) MouseButton(x, y int) bool

func (*Structure) Name

func (s *Structure) Name() string

func (*Structure) Pause

func (s *Structure) Pause()

func (*Structure) Planet

func (s *Structure) Planet() *planet.Planet

func (*Structure) Prioritize

func (s *Structure) Prioritize()

func (*Structure) Produce

func (s *Structure) Produce(count uint) bool

func (*Structure) Produces

func (s *Structure) Produces() int

func (*Structure) ReceiveCargo

func (s *Structure) ReceiveCargo(resource int)

func (*Structure) ResourceBarCallback

func (s *Structure) ResourceBarCallback(resource int) func() uint8

func (*Structure) ResourceLabelCallback

func (s *Structure) ResourceLabelCallback(displayName string, resource int) func() string

func (*Structure) ReturnShip

func (s *Structure) ReturnShip()

func (*Structure) Storage

func (s *Structure) Storage() map[int]*Storage

func (*Structure) StructureType

func (s *Structure) StructureType() int

func (*Structure) Unhighlight

func (s *Structure) Unhighlight()

func (*Structure) Unpause

func (s *Structure) Unpause()

func (*Structure) Upgrade

func (s *Structure) Upgrade(st int, sd *StructureData)

func (*Structure) UpgradeTo

func (s *Structure) UpgradeTo() int

func (*Structure) Upgradeable

func (s *Structure) Upgradeable() bool

func (*Structure) WorkerCapacity

func (s *Structure) WorkerCapacity() int

func (*Structure) WorkerCost

func (s *Structure) WorkerCost() int

func (*Structure) WorkersLabel

func (s *Structure) WorkersLabel() string

type StructureData

type StructureData struct {
	DisplayName string
	Produces    Production
	Storage     []Storage
	Consumes    []Consumption
	Workers     int
	WorkerCost  int
	Berths      int
	MinShips    int
	Cost        int
	Prioritize  int
	Class       int
	Upgrade     Upgrade
	Downgrade   Upgrade
	Buildable   bool
}

type Upgrade

type Upgrade struct {
	Structure int
	Required  []int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL