objects

package
v1.0.0-rc-2014 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2014 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Apple

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

func CreateApple

func CreateApple(pg *playground.Playground) (*Apple, error)

CreateApple creates and locates new apple

func (*Apple) Dot

func (a *Apple) Dot(i uint16) *playground.Dot

Implementing playground.Object interface

func (*Apple) DotCount

func (*Apple) DotCount() uint16

Implementing playground.Object interface

func (*Apple) NutritionalValue

func (a *Apple) NutritionalValue(dot *playground.Dot) int8

Implementing logic.Food interface

func (*Apple) Pack

func (a *Apple) Pack() string

Implementing playground.Object interface

type Corpse

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

Snakes can eat corpses

func CreateCorpse

func CreateCorpse(pg *playground.Playground, cxt context.Context,
	dots playground.DotList) (*Corpse, error)

Corpses are created when a snake dies

func (*Corpse) Dot

func (c *Corpse) Dot(i uint16) *playground.Dot

Implementing playground.Object interface

func (*Corpse) DotCount

func (c *Corpse) DotCount() uint16

Implementing playground.Object interface

func (*Corpse) NutritionalValue

func (c *Corpse) NutritionalValue(dot *playground.Dot) int8

Implementing logic.Food interface

func (*Corpse) Pack

func (c *Corpse) Pack() string

Implementing playground.Object interface

func (*Corpse) PackChanges

func (c *Corpse) PackChanges() string

Implementing playground.Shifting interface

func (*Corpse) Updated

func (c *Corpse) Updated() time.Time

Implementing playground.Shifting interface. Updated returns last time when a piece of corpse was eaten

type Snake

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

Snake object

func CreateSnake

func CreateSnake(pg *playground.Playground, cxt context.Context,
) (*Snake, error)

CreateSnake creates new snake

func (*Snake) Command

func (s *Snake) Command(cmd string) error

Implementing logic.Controlled interface

func (*Snake) Die

func (s *Snake) Die()

Implementing logic.Living interface

func (*Snake) Dot

func (s *Snake) Dot(i uint16) *playground.Dot

Implementing playground.Object interface

func (*Snake) DotCount

func (s *Snake) DotCount() uint16

Implementing playground.Object interface

func (*Snake) Feed

func (s *Snake) Feed(f int8)

Implementing logic.Living interface

func (*Snake) Pack

func (s *Snake) Pack() string

Implementing playground.Object interface

func (*Snake) PackChanges

func (s *Snake) PackChanges() string

Implementing playground.Shifting interface

func (*Snake) Strength

func (s *Snake) Strength() float32

Implementing logic.Resistant interface

func (*Snake) Updated

func (s *Snake) Updated() time.Time

Implementing playground.Shifting interface

type Wall

type Wall playground.DotList

func CreateLongWall

func CreateLongWall(pg *playground.Playground) (Wall, error)

func CreateWall

func CreateWall(pg *playground.Playground, dots playground.DotList,
) (Wall, error)

func (Wall) Break

func (w Wall) Break(dot *playground.Dot)

Implementing logic.Notalive interface

func (Wall) Dot

func (w Wall) Dot(i uint16) *playground.Dot

Implementing playground.Object interface

func (Wall) DotCount

func (w Wall) DotCount() uint16

Implementing playground.Object interface

func (Wall) Pack

func (w Wall) Pack() string

Implementing playground.Object interface

func (Wall) Strength

func (Wall) Strength() float32

Implementing logic.Resistant interface

type Watermelon

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

func CreateWatermelon

func CreateWatermelon(pg *playground.Playground, cxt context.Context,
) (*Watermelon, error)

func (*Watermelon) Dot

func (w *Watermelon) Dot(i uint16) (dot *playground.Dot)

Implementing playground.Object interface

func (*Watermelon) DotCount

func (w *Watermelon) DotCount() (c uint16)

Implementing playground.Object interface

func (*Watermelon) NutritionalValue

func (w *Watermelon) NutritionalValue(dot *playground.Dot) int8

Implementing logic.Food interface

func (*Watermelon) Pack

func (w *Watermelon) Pack() (res string)

Implementing playground.Object interface

func (*Watermelon) PackChanges

func (w *Watermelon) PackChanges() string

Implementing playground.Shifting interface

func (*Watermelon) Updated

func (w *Watermelon) Updated() time.Time

Implementing playground.Shifting interface

Jump to

Keyboard shortcuts

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