logic

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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRecognizingObject = errors.New("Cannot recognize object")
	ErrExecuteCommand    = errors.New("Cannot execute command")
)

Functions

func Clash

func Clash(first Living, second Object, dot *playground.Dot) error

Clash implements logic of clash of two objects (first and second) in dot dot

Types

type Controlled

type Controlled interface {
	Object
	Command(string) error
}

Object game characteristics

type Food

type Food interface {
	Object
	// Nutritional value
	NutritionalValue(*playground.Dot) int8
}

Object game characteristics

type Living

type Living interface {
	Object
	Resistant

	// Every living thing ever dies
	Die()
	// Living things are hungry
	Feed(int8)
}

Object game characteristics

type Notalive

type Notalive interface {
	Object
	Break(*playground.Dot)
}

Object game characteristics

type Object

type Object interface{}

Object game characteristics

type Resistant

type Resistant interface {
	Object
	Strength() float32
}

Object game characteristics

Jump to

Keyboard shortcuts

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