Documentation ¶
Index ¶
- Variables
- type ErrCreateObject
- type ErrCreateObjectAvailableDots
- type ErrCreateObjectRandomDot
- type ErrCreateRandomRectObject
- type ErrDeleteObject
- type ErrLocationDotsOccupiedByObjects
- type ErrLocationUsedByObject
- type ErrUpdateObject
- type ErrUpdateObjectAvailableDots
- type Playground
- func (pg *Playground) CreateObject(object interface{}, location engine.Location) *ErrCreateObject
- func (pg *Playground) CreateObjectAvailableDots(object interface{}, location engine.Location) (engine.Location, *ErrCreateObjectAvailableDots)
- func (pg *Playground) CreateObjectRandomDot(object interface{}) (engine.Location, error)
- func (pg *Playground) CreateObjectRandomRect(object interface{}, rw, rh uint8) (engine.Location, error)
- func (pg *Playground) DeleteObject(object interface{}, location engine.Location) *ErrDeleteObject
- func (pg *Playground) EntityExists(object interface{}, location engine.Location) bool
- func (pg *Playground) GetEntityByDot(dot engine.Dot) (interface{}, engine.Location)
- func (pg *Playground) GetObjectByDot(dot engine.Dot) interface{}
- func (pg *Playground) GetObjectByLocation(location engine.Location) interface{}
- func (pg *Playground) GetObjects() []interface{}
- func (pg *Playground) GetObjectsByDots(dots []engine.Dot) []interface{}
- func (pg *Playground) Height() uint8
- func (pg *Playground) LocationExists(location engine.Location) bool
- func (pg *Playground) Navigate(dot engine.Dot, dir engine.Direction, dis uint8) (engine.Dot, error)
- func (pg *Playground) ObjectExists(object interface{}) bool
- func (pg *Playground) Size() uint16
- func (pg *Playground) UpdateObject(object interface{}, old, new engine.Location) *ErrUpdateObject
- func (pg *Playground) UpdateObjectAvailableDots(object interface{}, old, new engine.Location) (engine.Location, *ErrUpdateObjectAvailableDots)
- func (pg *Playground) Width() uint8
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyLocation = errors.New("empty location")
Functions ¶
This section is empty.
Types ¶
type ErrCreateObject ¶
type ErrCreateObject struct {
Err error
}
func (*ErrCreateObject) Error ¶
func (e *ErrCreateObject) Error() string
type ErrCreateObjectAvailableDots ¶
type ErrCreateObjectAvailableDots struct {
Err error
}
func (*ErrCreateObjectAvailableDots) Error ¶
func (e *ErrCreateObjectAvailableDots) Error() string
type ErrCreateObjectRandomDot ¶
type ErrCreateObjectRandomDot string
func (ErrCreateObjectRandomDot) Error ¶
func (e ErrCreateObjectRandomDot) Error() string
type ErrCreateRandomRectObject ¶
type ErrCreateRandomRectObject string
func (ErrCreateRandomRectObject) Error ¶
func (e ErrCreateRandomRectObject) Error() string
type ErrDeleteObject ¶
type ErrDeleteObject struct {
Err error
}
func (*ErrDeleteObject) Error ¶
func (e *ErrDeleteObject) Error() string
type ErrLocationDotsOccupiedByObjects ¶
type ErrLocationDotsOccupiedByObjects struct {
Objects []interface{}
}
func (*ErrLocationDotsOccupiedByObjects) Error ¶
func (e *ErrLocationDotsOccupiedByObjects) Error() string
type ErrLocationUsedByObject ¶
func (*ErrLocationUsedByObject) Error ¶
func (e *ErrLocationUsedByObject) Error() string
type ErrUpdateObject ¶
type ErrUpdateObject struct {
Err error
}
func (*ErrUpdateObject) Error ¶
func (e *ErrUpdateObject) Error() string
type ErrUpdateObjectAvailableDots ¶
type ErrUpdateObjectAvailableDots struct {
Err error
}
func (*ErrUpdateObjectAvailableDots) Error ¶
func (err *ErrUpdateObjectAvailableDots) 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) *ErrCreateObject
func (*Playground) CreateObjectAvailableDots ¶
func (pg *Playground) CreateObjectAvailableDots(object interface{}, location engine.Location) (engine.Location, *ErrCreateObjectAvailableDots)
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) DeleteObject ¶
func (pg *Playground) DeleteObject(object interface{}, location engine.Location) *ErrDeleteObject
func (*Playground) EntityExists ¶
func (pg *Playground) EntityExists(object interface{}, location engine.Location) bool
func (*Playground) GetEntityByDot ¶
func (pg *Playground) GetEntityByDot(dot engine.Dot) (interface{}, engine.Location)
func (*Playground) GetObjectByDot ¶
func (pg *Playground) GetObjectByDot(dot engine.Dot) interface{}
func (*Playground) GetObjectByLocation ¶
func (pg *Playground) GetObjectByLocation(location engine.Location) 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) LocationExists ¶
func (pg *Playground) LocationExists(location engine.Location) bool
func (*Playground) ObjectExists ¶
func (pg *Playground) ObjectExists(object interface{}) bool
func (*Playground) Size ¶
func (pg *Playground) Size() uint16
func (*Playground) UpdateObject ¶
func (pg *Playground) UpdateObject(object interface{}, old, new engine.Location) *ErrUpdateObject
func (*Playground) UpdateObjectAvailableDots ¶
func (pg *Playground) UpdateObjectAvailableDots(object interface{}, old, new engine.Location) (engine.Location, *ErrUpdateObjectAvailableDots)
func (*Playground) Width ¶
func (pg *Playground) Width() uint8
Click to show internal directories.
Click to hide internal directories.