Documentation
¶
Overview ¶
Package entity provides a typed Go client for the entity manipulation commands registered by softmod/factop/entity.lua.
Index ¶
- type Area
- type Client
- func (c *Client) Bulk(positions []Position, name, force, surface string) (int, error)
- func (c *Client) Count(area Area, opts FindOptions) (int, error)
- func (c *Client) Create(pos Position, name, force, direction, surface string) (string, error)
- func (c *Client) Destroy(area Area, opts FindOptions) (string, error)
- func (c *Client) Find(area Area, opts FindOptions) ([]Entity, error)
- type Entity
- type FindOptions
- type Position
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides typed methods for each entity-* RCON command.
func (*Client) Bulk ¶ added in v0.1.12
Bulk creates multiple entities of the same type in batched RCON calls. Positions are sent in batches to stay within RCON payload limits. Returns total created count and any error from the last failing batch.
func (*Client) Count ¶
func (c *Client) Count(area Area, opts FindOptions) (int, error)
Count returns the number of entities matching the filter in the area.
func (*Client) Create ¶
Create places a single entity at the given position. Direction uses Factorio direction names: "north", "south", "east", "west", etc. Pass empty strings for force/direction/surface to use defaults.
type Entity ¶
type Entity struct {
Name string `json:"name"`
X float64 `json:"x"`
Y float64 `json:"y"`
UnitNumber uint64 `json:"unit_number"`
}
Entity represents a found entity with its position and unit number.
type FindOptions ¶
FindOptions controls filtering for Find and Count operations. Use "_" or empty string to skip a filter field.