Documentation ¶
Index ¶
- Variables
- func Draw(ents []Entity, dst *image.RGBA, info map[string]EntityInfo)
- func Init(ents []Entity, offx, offy float64) *image.RGBA
- func LoadImage(name, fname string) (image.Image, error)
- func ParseEntityInfo() map[string]EntityInfo
- type Blueprint
- type BpParse
- type Connection
- type ConnectionDataObject
- type ConnectionPoint
- type Entity
- type EntityInfo
- type HrLayer
- type Icon
- type InventoryObject
- type ItemFilterObject
- type ItemRequestObject
- type Layer
- type LogisticsFilterObject
- type Orientation
- type Picture
- type PositionObject
- type ScheduleObject
- type ScheduleRecord
- type SignalId
- type SpeakerAlertParameterObject
- type SpeakerParameterObject
- type Tile
- type WaitCondition
Constants ¶
This section is empty.
Variables ¶
View Source
var FactorioPath string
View Source
var ImgCache map[string]image.Image
Functions ¶
func Draw ¶
func Draw(ents []Entity, dst *image.RGBA, info map[string]EntityInfo)
Main drawing function. Calls the corresponding drawing functions for every entity in the blueprint ents - entity array from the blueprint string dst - the image used as a canvas for drawing
func Init ¶
Initializes drawing canvas with the right size ents - entity array from blueprint string offx - by how much change the X axis so that the smallest X coordinate in blueprint is on 0 offx - Y Y returns the image canvas pointer and all drawers that are needed for this blueprint render
func LoadImage ¶
Reads entity texture If the entity is animated, the entire texture atlas is returned
func ParseEntityInfo ¶
func ParseEntityInfo() map[string]EntityInfo
Types ¶
type Blueprint ¶
type Blueprint struct { Item string `json:"item"` Label string `json:"label"` LabelColor color.RGBA `json:"label_color"` Entities []Entity `json:"entities"` Tiles []Tile `json:"tiles"` Icons []Icon `json:"icons"` Schedules []ScheduleObject `json:"schedules"` Version int64 `json:"version"` }
func ParseBPString ¶
type Connection ¶
type Connection struct { One ConnectionPoint `json:"1"` Two ConnectionPoint `json:"2"` }
type ConnectionDataObject ¶
type ConnectionPoint ¶
type ConnectionPoint struct { Red []ConnectionDataObject `json:"red"` Green []ConnectionDataObject `json:"green"` }
type Entity ¶
type Entity struct { Number int `json:"entity_number"` Name string `json:"name"` Position PositionObject `json:"position"` Direction int `json:"direction"` Orientation float64 `json:"orientation"` Connections Connection `json:"connections"` //TODO: controlBehaviour Items ItemRequestObject `json:"items"` Recipe string `json:"recipe"` Bar int `json:"bar"` Inventory InventoryObject `json:"inventory"` Type string `json:"type"` InputPriority string `json:"input_priority"` OutputPriority string `json:"output_priority"` Filter string `json:"filter"` Filters []ItemFilterObject `json:"filters"` FilterMode string `json:"filter_mode"` OverrideStackSize uint8 `json:"override_stack_size"` DropPosition PositionObject `json:"drop_position"` PickupPosition PositionObject `json:"pickup_position"` RequestFilters []LogisticsFilterObject `json:"request_filters"` RequestFromBuffers bool `json:"request_from_buffers"` Parameters SpeakerParameterObject `json:"parameters"` AlertParameters SpeakerAlertParameterObject `json:"alert_parameters"` AutoLaunch bool `json:"auto_launch"` Color color.RGBA `json:"color"` Station string `json:"station"` }
type EntityInfo ¶
type EntityInfo struct {
Picture Picture `json:"picture"`
}
type InventoryObject ¶
type InventoryObject struct { Filters []ItemFilterObject `json:"filters"` Bar int `json:"bar"` }
type ItemFilterObject ¶
type ItemRequestObject ¶
type LogisticsFilterObject ¶
type Orientation ¶
type Orientation struct {
Layers []Layer `json:"layers"`
}
type Picture ¶
type Picture struct { Layers []Layer `json:"layers"` North Orientation `json:"north"` West Orientation `json:"west"` East Orientation `json:"east"` South Orientation `json:"south"` }
type PositionObject ¶
type ScheduleObject ¶
type ScheduleObject struct { Schedule []ScheduleRecord `json:"entity_number"` Locomotives int `json:"entity_number"` }
type ScheduleRecord ¶
type ScheduleRecord struct { Station string `json:"entity_number"` WaitConditions []WaitCondition `json:"entity_number"` }
type SpeakerParameterObject ¶
type Tile ¶
type Tile struct { Name string `json:"name"` Position PositionObject `json:"position"` }
type WaitCondition ¶
Click to show internal directories.
Click to hide internal directories.