factory

package
v0.0.0-...-0c1458e Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Building

type Building interface {
	InstanceName() string
	BuildTimestamp() time.Duration
	Recipe() Recipe.FGRecipe
	PrimaryColor() property.LinearColorStruct
	SecondaryColor() property.LinearColorStruct
	Entity() save.Entity
	ID() int64
	TypePath() typepath.TypePath
}

Building is implemented by all Satisfactory buildings

type Connection

type Connection struct {
	// Connected is the non-conveyor belt Building that this input or output
	// is connected to.
	//
	// Will be nil if there is no terminating Building.
	Connected Building
	// ConveyorBelts contains all the Conveyor objects in order from the input or output to
	// the Connected Building.
	ConveyorBelts []Conveyor
}

Connection details what a buildings input or output is connected to.

type Constructor

type Constructor struct {
	// contains filtered or unexported fields
}

func (Constructor) BuildTimestamp

func (b Constructor) BuildTimestamp() time.Duration

BuildTimestamp returns the duration between when the game started and when the building was constructed.

func (Constructor) CurrentRecipe

func (p Constructor) CurrentRecipe() *Recipe.FGRecipe

CurrentRecipe returns the currently assigned recipe for this production machine. Returns nil if the machine has no recipe assigned.

func (Constructor) Descriptor

func (b Constructor) Descriptor() BuildingDescriptor.FGBuildingDescriptor

Descriptor returns the descriptor for this building based on the data provided in the satisfactory Docs.json that ships with the game.

func (Constructor) Entity

func (b Constructor) Entity() save.Entity

Entity returns the entity from the save file for this building.

func (Constructor) GetInput

func (i Constructor) GetInput() *Connection

GetInput returns the Connection for this input. If the input is not connected to anything then nil will be returned.

func (Constructor) GetOutput

func (o Constructor) GetOutput() *Connection

GetOutput returns the Connection for this output. If the output is not connected to anything then nil will be returned.

func (Constructor) ID

func (b Constructor) ID() int64

ID returns the unique identifier for this building

func (Constructor) InputInventory

func (p Constructor) InputInventory() []*InventoryStack

InputInventory returns the input inventory of this building.

func (Constructor) InstanceName

func (b Constructor) InstanceName() string

func (Constructor) IsProducing

func (p Constructor) IsProducing() bool

IsProducing returns true if this building is currently producing.

func (Constructor) OutputInventory

func (p Constructor) OutputInventory() []*InventoryStack

OutputInventory returns the output inventory of this building.

func (Constructor) PowerConsumption

func (p Constructor) PowerConsumption() float32

PowerConsumption returns the power consumption of this building.

func (Constructor) PrimaryColor

func (b Constructor) PrimaryColor() property.LinearColorStruct

PrimaryColor returns the RGBA of the buildings primary color.

func (Constructor) Recipe

func (b Constructor) Recipe() Recipe.FGRecipe

Recipe returns the recipe for constructing this building.

func (Constructor) SecondaryColor

func (b Constructor) SecondaryColor() property.LinearColorStruct

SecondaryColor returns the RGBA of the buildings secondary color.

func (Constructor) TimeSinceStartOrStopProducing

func (p Constructor) TimeSinceStartOrStopProducing() time.Duration

TimeSinceStartOrStopProducing returns the amount of time that has elapsed since the building started or stopped producing.

func (Constructor) TypePath

func (b Constructor) TypePath() typepath.TypePath

TypePath returns the type path for this building.

type Conveyor

type Conveyor interface {
	BeltContents() []*InventoryStack
}

Conveyor is implemented by ConveyorBelt and ConveyorLift

type ConveyorBelt

type ConveyorBelt struct {
	Mark int

	BeltDescriptor BuildableConveyorBelt.FGBuildableConveyorBelt
	// contains filtered or unexported fields
}

func (*ConveyorBelt) BeltContents

func (c *ConveyorBelt) BeltContents() []*InventoryStack

BeltContents will return the items that are currently on this ConveyorBelt

func (ConveyorBelt) BuildTimestamp

func (b ConveyorBelt) BuildTimestamp() time.Duration

BuildTimestamp returns the duration between when the game started and when the building was constructed.

func (ConveyorBelt) Descriptor

func (b ConveyorBelt) Descriptor() BuildingDescriptor.FGBuildingDescriptor

Descriptor returns the descriptor for this building based on the data provided in the satisfactory Docs.json that ships with the game.

func (ConveyorBelt) Entity

func (b ConveyorBelt) Entity() save.Entity

Entity returns the entity from the save file for this building.

func (ConveyorBelt) ID

func (b ConveyorBelt) ID() int64

ID returns the unique identifier for this building

func (ConveyorBelt) InstanceName

func (b ConveyorBelt) InstanceName() string

func (ConveyorBelt) PrimaryColor

func (b ConveyorBelt) PrimaryColor() property.LinearColorStruct

PrimaryColor returns the RGBA of the buildings primary color.

func (ConveyorBelt) Recipe

func (b ConveyorBelt) Recipe() Recipe.FGRecipe

Recipe returns the recipe for constructing this building.

func (ConveyorBelt) SecondaryColor

func (b ConveyorBelt) SecondaryColor() property.LinearColorStruct

SecondaryColor returns the RGBA of the buildings secondary color.

func (ConveyorBelt) TypePath

func (b ConveyorBelt) TypePath() typepath.TypePath

TypePath returns the type path for this building.

type ConveyorLift

type ConveyorLift struct {
	Mark           int
	LiftDescriptor BuildableConveyorLift.FGBuildableConveyorLift
	// contains filtered or unexported fields
}

func (*ConveyorLift) BeltContents

func (c *ConveyorLift) BeltContents() []*InventoryStack

BeltContents will return the items that are currently on this ConveyorLift

func (ConveyorLift) BuildTimestamp

func (b ConveyorLift) BuildTimestamp() time.Duration

BuildTimestamp returns the duration between when the game started and when the building was constructed.

func (ConveyorLift) Descriptor

func (b ConveyorLift) Descriptor() BuildingDescriptor.FGBuildingDescriptor

Descriptor returns the descriptor for this building based on the data provided in the satisfactory Docs.json that ships with the game.

func (ConveyorLift) Entity

func (b ConveyorLift) Entity() save.Entity

Entity returns the entity from the save file for this building.

func (ConveyorLift) ID

func (b ConveyorLift) ID() int64

ID returns the unique identifier for this building

func (ConveyorLift) InstanceName

func (b ConveyorLift) InstanceName() string

func (ConveyorLift) PrimaryColor

func (b ConveyorLift) PrimaryColor() property.LinearColorStruct

PrimaryColor returns the RGBA of the buildings primary color.

func (ConveyorLift) Recipe

func (b ConveyorLift) Recipe() Recipe.FGRecipe

Recipe returns the recipe for constructing this building.

func (ConveyorLift) SecondaryColor

func (b ConveyorLift) SecondaryColor() property.LinearColorStruct

SecondaryColor returns the RGBA of the buildings secondary color.

func (ConveyorLift) TypePath

func (b ConveyorLift) TypePath() typepath.TypePath

TypePath returns the type path for this building.

type Factory

type Factory struct {
	Buildings         map[string]Building
	Mergers           map[string]*Merger
	Splitters         map[string]*Splitter
	StorageContainers map[string]*StorageContainer
	Conveyors         map[string]Conveyor
	Production        map[string]Production
	// contains filtered or unexported fields
}

func Load

func Load(r io.Reader) (*Factory, error)

Load the provided Satisfactory save file.

type InventoryStackType

type InventoryStackType string
const (
	ItemStackType     InventoryStackType = "ItemStack"
	ResourceStackType InventoryStackType = "ResourceStack"
	BiomassStackType  InventoryStackType = "BiomassStack"
)

type Merger

type Merger struct {
	// contains filtered or unexported fields
}

func (Merger) BuildTimestamp

func (b Merger) BuildTimestamp() time.Duration

BuildTimestamp returns the duration between when the game started and when the building was constructed.

func (Merger) Descriptor

func (b Merger) Descriptor() BuildingDescriptor.FGBuildingDescriptor

Descriptor returns the descriptor for this building based on the data provided in the satisfactory Docs.json that ships with the game.

func (Merger) Entity

func (b Merger) Entity() save.Entity

Entity returns the entity from the save file for this building.

func (Merger) GetInputs

func (i Merger) GetInputs() []*Connection

func (Merger) GetOutput

func (o Merger) GetOutput() *Connection

GetOutput returns the Connection for this output. If the output is not connected to anything then nil will be returned.

func (Merger) ID

func (b Merger) ID() int64

ID returns the unique identifier for this building

func (Merger) InstanceName

func (b Merger) InstanceName() string

func (Merger) Inventory

func (s Merger) Inventory() []*InventoryStack

Inventory returns the contents of this building.

func (Merger) PrimaryColor

func (b Merger) PrimaryColor() property.LinearColorStruct

PrimaryColor returns the RGBA of the buildings primary color.

func (Merger) Recipe

func (b Merger) Recipe() Recipe.FGRecipe

Recipe returns the recipe for constructing this building.

func (Merger) SecondaryColor

func (b Merger) SecondaryColor() property.LinearColorStruct

SecondaryColor returns the RGBA of the buildings secondary color.

func (Merger) TypePath

func (b Merger) TypePath() typepath.TypePath

TypePath returns the type path for this building.

type Production

type Production interface {
	PowerConsumption() float32
	CurrentRecipe() *Recipe.FGRecipe
	InputInventory() []*InventoryStack
	OutputInventory() []*InventoryStack
	IsProducing() bool
	TimeSinceStartOrStopProducing() time.Duration
}

Production is implemented by all Satisfactory production buildings. e.g. Constructor and Assembler

type Splitter

type Splitter struct {
	// contains filtered or unexported fields
}

func (Splitter) BuildTimestamp

func (b Splitter) BuildTimestamp() time.Duration

BuildTimestamp returns the duration between when the game started and when the building was constructed.

func (Splitter) Descriptor

func (b Splitter) Descriptor() BuildingDescriptor.FGBuildingDescriptor

Descriptor returns the descriptor for this building based on the data provided in the satisfactory Docs.json that ships with the game.

func (Splitter) Entity

func (b Splitter) Entity() save.Entity

Entity returns the entity from the save file for this building.

func (Splitter) GetInput

func (i Splitter) GetInput() *Connection

GetInput returns the Connection for this input. If the input is not connected to anything then nil will be returned.

func (Splitter) GetOutputs

func (o Splitter) GetOutputs() []*Connection

func (Splitter) ID

func (b Splitter) ID() int64

ID returns the unique identifier for this building

func (Splitter) InstanceName

func (b Splitter) InstanceName() string

func (Splitter) Inventory

func (s Splitter) Inventory() []*InventoryStack

Inventory returns the contents of this building.

func (Splitter) PrimaryColor

func (b Splitter) PrimaryColor() property.LinearColorStruct

PrimaryColor returns the RGBA of the buildings primary color.

func (Splitter) Recipe

func (b Splitter) Recipe() Recipe.FGRecipe

Recipe returns the recipe for constructing this building.

func (Splitter) SecondaryColor

func (b Splitter) SecondaryColor() property.LinearColorStruct

SecondaryColor returns the RGBA of the buildings secondary color.

func (Splitter) TypePath

func (b Splitter) TypePath() typepath.TypePath

TypePath returns the type path for this building.

type StorageContainer

type StorageContainer struct {
	Mark              int
	StorageDescriptor BuildableStorage.FGBuildableStorage
	// contains filtered or unexported fields
}

func (StorageContainer) BuildTimestamp

func (b StorageContainer) BuildTimestamp() time.Duration

BuildTimestamp returns the duration between when the game started and when the building was constructed.

func (StorageContainer) Descriptor

func (b StorageContainer) Descriptor() BuildingDescriptor.FGBuildingDescriptor

Descriptor returns the descriptor for this building based on the data provided in the satisfactory Docs.json that ships with the game.

func (StorageContainer) Entity

func (b StorageContainer) Entity() save.Entity

Entity returns the entity from the save file for this building.

func (StorageContainer) ID

func (b StorageContainer) ID() int64

ID returns the unique identifier for this building

func (StorageContainer) InstanceName

func (b StorageContainer) InstanceName() string

func (StorageContainer) Inventory

func (s StorageContainer) Inventory() []*InventoryStack

Inventory returns the contents of this building.

func (StorageContainer) PrimaryColor

func (b StorageContainer) PrimaryColor() property.LinearColorStruct

PrimaryColor returns the RGBA of the buildings primary color.

func (StorageContainer) Recipe

func (b StorageContainer) Recipe() Recipe.FGRecipe

Recipe returns the recipe for constructing this building.

func (StorageContainer) SecondaryColor

func (b StorageContainer) SecondaryColor() property.LinearColorStruct

SecondaryColor returns the RGBA of the buildings secondary color.

func (StorageContainer) TypePath

func (b StorageContainer) TypePath() typepath.TypePath

TypePath returns the type path for this building.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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