Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Building ¶
Building instances are like Renderables with additional information.
type Cursor ¶
Cursor represents the location of the player as well as what mode and building they are currently acting as.
type Dimensions ¶
Dimensions wraps a width and height.
func (*Dimensions) Area ¶
func (d *Dimensions) Area() int
Area returns the product of the width and height.
func (*Dimensions) Dup ¶
func (d *Dimensions) Dup() Dimensions
Dup returns a fresh copy of the dimensions.
func (*Dimensions) Midway ¶
func (d *Dimensions) Midway() (int, int)
Midway returns the x and y values of the width and height divided by two.
func (*Dimensions) MidwayPoint ¶
func (d *Dimensions) MidwayPoint() Point
MidwayPoint returns a point from the midway values.
func (*Dimensions) String ¶
func (d *Dimensions) String() string
String returns a human readble interpretation of the dimensions.
func (*Dimensions) Values ¶
func (d *Dimensions) Values() (int, int)
Values returns a tupe of the width and height values.
type Game ¶
type Game struct { Cursor Cursor Dimensions Dimensions World Dimensions Buildings []Building Turn Turn Funds int Revenue int Population int PopulationGrowth int Flashes []Flash Frame int Debug bool }
Game represents the state of the game.
type Neighbor ¶
Neighbor is used to create an array of buildings that are adjacent to a given building.
type Point ¶
Point wraps an x and y position.
type Renderable ¶
Renderable represents a location and a symbol to be rendered.
func (*Renderable) String ¶
func (r *Renderable) String() string
String returns a human readable version of the renderable.
type Turn ¶
type Turn struct { Actions TurnActions Start time.Time }
Turn holds the information about the current turn.
func (*Turn) Progress ¶
Progress returns two 0-1 floating point numbers representing the completeness of the turn.
func (*Turn) TimeElapsed ¶
TimeElapsed calculates how long this turn has been going on.
type TurnActions ¶
TurnActions store how many actions a user has taken this turn and how many they are allowed to.