parking

package
v0.0.0-...-e2c65c2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package parking provides an animated simulation of cars (emoji) entering and exiting a parking lot (line art).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lot

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

Lot captures the states of all cars and the data structures necessary to coordinate their right of way for each tick.

func NewLotForBounds

func NewLotForBounds(bounds image.Rectangle) *Lot

NewLotForBounds creates a parking lot that covers the given rectangle, rounding up.

func (*Lot) Bounds

func (lot *Lot) Bounds() image.Rectangle

Bounds returns the maximum rectangle that this lot can draw over.

func (*Lot) Draw

func (lot *Lot) Draw(dis *display.Display, box image.Rectangle)

Draw draws the parking lot onto the given display, at its origin.

func (*Lot) Tick

func (lot *Lot) Tick()

Tick advances the parking lot state by one tick.

Jump to

Keyboard shortcuts

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