entity

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2017 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

Package entity represents functionality that is core to the base entity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity interface {
	// ID retrieves the id of this entity.
	ID() string
	// AddComponent adds a component to the entity.  Returns an error if the component type has already been added.
	AddComponent(components.Component) error
	// RemoveComponent removes a component from the entity.  If the component type is not already attached an error will be returned.
	RemoveComponent(string) error
	// ReplaceComponent replaces an existing component with a new one of the same type.
	ReplaceComponent(c components.Component) error
	// Component retrieves a component based on its component type.
	Component(string) components.Component
	// Retrieves a list of component types that have been attached to this entity.
	ComponentTypes() []string
}

Entity represents the basic behaviors all engine entities possess.

func NewEntity

func NewEntity(id string) Entity

NewEntity creates a new entity with the given ID.

Jump to

Keyboard shortcuts

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