playground

package
v4.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRetriesLimit = errors.New("retries limit was reached")
View Source
var FindRetriesNumber = 64

Functions

This section is empty.

Types

type ErrCreatePlayground

type ErrCreatePlayground struct {
	Err error
}

func (ErrCreatePlayground) Error

func (e ErrCreatePlayground) Error() string

type Playground

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

func NewPlayground

func NewPlayground(width, height uint8) (*Playground, error)

func (*Playground) CreateObject

func (pg *Playground) CreateObject(object interface{}, location engine.Location) error

func (*Playground) CreateObjectAvailableDots

func (pg *Playground) CreateObjectAvailableDots(object interface{}, location engine.Location) (engine.Location, error)

func (*Playground) CreateObjectRandomByDotsMask

func (pg *Playground) CreateObjectRandomByDotsMask(object interface{}, dm *engine.DotsMask) (engine.Location, error)

func (*Playground) CreateObjectRandomDot

func (pg *Playground) CreateObjectRandomDot(object interface{}) (engine.Location, error)

func (*Playground) CreateObjectRandomRect

func (pg *Playground) CreateObjectRandomRect(object interface{}, rw, rh uint8) (engine.Location, error)

func (*Playground) CreateObjectRandomRectMargin

func (pg *Playground) CreateObjectRandomRectMargin(object interface{}, rw, rh, margin uint8) (engine.Location, error)

func (*Playground) DeleteObject

func (pg *Playground) DeleteObject(object interface{}, location engine.Location) error

func (*Playground) GetObjectByDot

func (pg *Playground) GetObjectByDot(dot engine.Dot) interface{}

func (*Playground) GetObjects

func (pg *Playground) GetObjects() []interface{}

func (*Playground) GetObjectsByDots

func (pg *Playground) GetObjectsByDots(dots []engine.Dot) []interface{}

func (*Playground) Height

func (pg *Playground) Height() uint8

func (*Playground) LocationOccupied

func (pg *Playground) LocationOccupied(location engine.Location) bool

func (*Playground) Navigate

func (pg *Playground) Navigate(dot engine.Dot, dir engine.Direction, dis uint8) (engine.Dot, error)

func (*Playground) Size

func (pg *Playground) Size() uint16

func (*Playground) UpdateObject

func (pg *Playground) UpdateObject(object interface{}, old, new engine.Location) error

func (*Playground) UpdateObjectAvailableDots

func (pg *Playground) UpdateObjectAvailableDots(object interface{}, old, new engine.Location) (engine.Location, error)

func (*Playground) Width

func (pg *Playground) Width() uint8

Jump to

Keyboard shortcuts

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