Documentation
¶
Overview ¶
Package surface provides a typed Go client for the surface property and chunk management commands registered by softmod/factop/surface.lua.
Index ¶
- type Client
- func (c *Client) ClearPollution(surface string) (string, error)
- func (c *Client) DeleteChunk(cx, cy int, surface string) (string, error)
- func (c *Client) Generate(x, y float64, radius int, surface string) (string, error)
- func (c *Client) GetInfo(surface string) (*Info, error)
- func (c *Client) List() ([]SurfaceEntry, error)
- func (c *Client) Set(property, value string, surface string) (string, error)
- type Info
- type SurfaceEntry
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 surface-* RCON command.
func (*Client) ClearPollution ¶
ClearPollution clears all pollution on the surface.
func (*Client) DeleteChunk ¶
DeleteChunk deletes a chunk at the given chunk coordinates.
func (*Client) Generate ¶
Generate requests chunk generation at the given position with optional radius.
type Info ¶
type Info struct {
Name string `json:"name"`
Index int `json:"index"`
AlwaysDay bool `json:"always_day"`
Daytime float64 `json:"daytime"`
Darkness float64 `json:"darkness"`
FreezeDaytime bool `json:"freeze_daytime"`
PeacefulMode bool `json:"peaceful_mode"`
NoEnemiesMode bool `json:"no_enemies_mode"`
WindSpeed float64 `json:"wind_speed"`
WindOrientation float64 `json:"wind_orientation"`
SolarPowerMultiplier float64 `json:"solar_power_multiplier"`
MinBrightness float64 `json:"min_brightness"`
TicksPerDay int `json:"ticks_per_day"`
ShowClouds bool `json:"show_clouds"`
GenerateWithLabTiles bool `json:"generate_with_lab_tiles"`
}
Info holds the parsed surface properties from surface-info.
type SurfaceEntry ¶
SurfaceEntry is a name:index pair from surface-list.
func ParseList ¶
func ParseList(s string) ([]SurfaceEntry, error)
ParseList parses the surface-list wire format: name:index,name:index,...
Click to show internal directories.
Click to hide internal directories.