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(p GameProcessor, 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) NutritionalValue ¶
func (a *Apple) NutritionalValue(dot *playground.Dot) int8
Implementing logic.Food interface
type Corpse ¶
type Corpse struct {
// contains filtered or unexported fields
}
Snakes can eat corpses
func CreateCorpse ¶
func CreateCorpse(p GameProcessor, 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) NutritionalValue ¶
func (c *Corpse) NutritionalValue(dot *playground.Dot) int8
Implementing logic.Food interface
type GameProcessor ¶
type GameProcessor interface { OccurredError(object interface{}, err error) OccurredCreating(object interface{}) OccurredDeleting(object interface{}) OccurredUpdating(object interface{}) }
objects use GameProcessor to notifying about its states
type Snake ¶
type Snake struct {
// contains filtered or unexported fields
}
Snake object
func CreateSnake ¶
func CreateSnake(p GameProcessor, pg *playground.Playground, cxt context.Context) (*Snake, error)
CreateSnake creates new snake
type Wall ¶
type Wall struct {
// contains filtered or unexported fields
}
func CreateLongWall ¶
func CreateLongWall(p GameProcessor, pg *playground.Playground, ) (*Wall, error)
func CreateWall ¶
func CreateWall(p GameProcessor, pg *playground.Playground, dots playground.DotList) (*Wall, error)
func (*Wall) Break ¶
func (w *Wall) Break(dot *playground.Dot)
Implementing logic.Notalive interface
type Watermelon ¶
type Watermelon struct {
// contains filtered or unexported fields
}
func CreateWatermelon ¶
func CreateWatermelon(p GameProcessor, 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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.