food

package
v0.0.0-...-309fd15 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Food

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

Food structs hold the key properties of food.

func New

func New(cm locationmanager.Detection, foodLevel float64) *Food

Initialize a new food object.

func (*Food) Check

func (f *Food) Check() bool

Attempt to tear down a food object. Call this at the end of each cycle, to remove it from the collision manager. Returns a boolean for whether the teardown occured.

func (*Food) Color

func (f *Food) Color() color.RGBA

Get the color of the food. This never changes.

func (*Food) Consume

func (f *Food) Consume() float64

Consumption of the food. Returns the food content eaten.

func (*Food) GetContent

func (f *Food) GetContent() float64

Content checking. This is provided for testing purposes.

func (*Food) Radius

func (f *Food) Radius() float64

Check the size of the food. This is calculated from the amount of food represented by the instance.

func (*Food) Work

func (f *Food) Work()

Food does no work.

Jump to

Keyboard shortcuts

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