entity

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package entity contains the objects to manage the Entity objects in a ECS

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

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

Entity represents a instance of an object in a ECS

func New

func New(components ...interface{}) *Entity

New creates a new Entity giving a set of varg components

func (*Entity) Add

func (ent *Entity) Add(component interface{}) *Entity

Add a new component into an Entity

func (Entity) Contains

func (ent Entity) Contains(rtypes ...reflect.Type) bool

Contains check that the Entity has the given varg reflect.Type

func (Entity) Get

func (ent Entity) Get(rtype reflect.Type) interface{}

Get the component of the given reflect.Type

func (Entity) ID added in v0.1.7

func (ent Entity) ID() int64

ID : get the unique id for this Entity

func (*Entity) Set

func (ent *Entity) Set(component interface{}) *Entity

Set a new component into an Entity

func (Entity) String

func (ent Entity) String() string

String : get a string representation of an Entity

Jump to

Keyboard shortcuts

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