Documentation ¶
Index ¶
- type Event
- type EventType
- type Identifier
- type IdentifierRegistry
- type Interface
- type World
- func (w *World) Area() engine.Area
- func (w *World) CreateObject(object interface{}, location engine.Location) error
- func (w *World) CreateObjectAvailableDots(object interface{}, location engine.Location) (engine.Location, error)
- func (w *World) CreateObjectRandomByDotsMask(object interface{}, dm *engine.DotsMask) (engine.Location, error)
- func (w *World) CreateObjectRandomDot(object interface{}) (engine.Location, error)
- func (w *World) CreateObjectRandomRect(object interface{}, rw, rh uint8) (engine.Location, error)
- func (w *World) CreateObjectRandomRectMargin(object interface{}, rw, rh, margin uint8) (engine.Location, error)
- func (w *World) DeleteObject(object interface{}, location engine.Location) error
- func (w *World) Events(stop <-chan struct{}, buffer uint) <-chan Event
- func (w *World) GetObjectByDot(dot engine.Dot) interface{}
- func (w *World) GetObjects() []interface{}
- func (w *World) GetObjectsByDots(dots []engine.Dot) []interface{}
- func (w *World) IdentifierRegistry() *IdentifierRegistry
- func (w *World) LocationOccupied(location engine.Location) bool
- func (w *World) Start(stop <-chan struct{})
- func (w *World) UpdateObject(object interface{}, old, new engine.Location) error
- func (w *World) UpdateObjectAvailableDots(object interface{}, old, new engine.Location) (engine.Location, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Type EventType Payload interface{} }
ffjson: nodecoder
func (*Event) MarshalJSON ¶
MarshalJSON marshal bytes to json - template
func (*Event) MarshalJSONBuf ¶
func (j *Event) MarshalJSONBuf(buf fflib.EncodingBuffer) error
MarshalJSONBuf marshal buff to json - template
type Identifier ¶
type Identifier uint32
func (Identifier) String ¶
func (i Identifier) String() string
type IdentifierRegistry ¶
type IdentifierRegistry struct {
// contains filtered or unexported fields
}
func NewIdentifierRegistry ¶
func NewIdentifierRegistry() *IdentifierRegistry
func (*IdentifierRegistry) Obtain ¶
func (ir *IdentifierRegistry) Obtain() Identifier
func (*IdentifierRegistry) Release ¶
func (ir *IdentifierRegistry) Release(id Identifier)
type Interface ¶
type Interface interface { Start(stop <-chan struct{}) Events(stop <-chan struct{}, buffer uint) <-chan Event GetObjectByDot(dot engine.Dot) interface{} GetObjectsByDots(dots []engine.Dot) []interface{} CreateObject(object interface{}, location engine.Location) error CreateObjectAvailableDots(object interface{}, location engine.Location) (engine.Location, error) DeleteObject(object interface{}, location engine.Location) error UpdateObject(object interface{}, old, new engine.Location) error UpdateObjectAvailableDots(object interface{}, old, new engine.Location) (engine.Location, error) CreateObjectRandomDot(object interface{}) (engine.Location, error) CreateObjectRandomRect(object interface{}, rw, rh uint8) (engine.Location, error) CreateObjectRandomRectMargin(object interface{}, rw, rh, margin uint8) (engine.Location, error) CreateObjectRandomByDotsMask(object interface{}, dm *engine.DotsMask) (engine.Location, error) LocationOccupied(location engine.Location) bool Area() engine.Area GetObjects() []interface{} IdentifierRegistry() *IdentifierRegistry }
type World ¶
type World struct {
// contains filtered or unexported fields
}
func (*World) CreateObject ¶
func (*World) CreateObjectAvailableDots ¶
func (*World) CreateObjectRandomByDotsMask ¶
func (*World) CreateObjectRandomDot ¶
func (*World) CreateObjectRandomRect ¶
func (*World) CreateObjectRandomRectMargin ¶
func (*World) DeleteObject ¶
func (*World) GetObjectByDot ¶
func (*World) GetObjects ¶
func (w *World) GetObjects() []interface{}
func (*World) GetObjectsByDots ¶
func (*World) IdentifierRegistry ¶
func (w *World) IdentifierRegistry() *IdentifierRegistry
func (*World) UpdateObject ¶
Click to show internal directories.
Click to hide internal directories.