Documentation ¶
Index ¶
Constants ¶
const MaxComponents = 10
MaxComponents is the total amount of components that each entity is allowed to have.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Acceleration ¶
Acceleration describes an entity's rate at which it increases it's velocity.
func (Acceleration) Name ¶
func (Acceleration) Name() string
type Colour ¶
type Colour struct {
Red, Green, Blue byte
}
Colour represents a set of bytes to show colour on a display in an RGB format.
type Component ¶
type Component interface {
Name() string
}
Component is a generic struct with data in them for systems to utilize.
type ComponentManager ¶
type ComponentManager interface { // Register will reserve a new ID by the given name for a component. Register(name string) // Read will return the component data by name for the given entity. Read(entity entity.Entity, name string) Component // Remove will delete the given component by name on the given entity. Remove(entity entity.Entity, name string) // Attach will assign a component data by name to the given entity. Attach(entity entity.Entity, name string, component Component) // Sign will create a signature for the given components by name that can be // assigned to an entity. Sign(names ...string) *bitset.BitSet // Signature will return the ID of a component by name. Signature(name string) int Destroy(entity entity.Entity) }
ComponentManager takes care of creating, deleting, reading, and signing components to entities.
func CreateComponentManager ¶
func CreateComponentManager() ComponentManager
CreateComponentManager will new up an empty manager with no components or signatures registered.
type Dimensions ¶
type Dimensions struct {
Width, Height, Radius float32
}
Dimensions is a representation of the 2D geomtry that makes up an object in the game world.
func (Dimensions) Name ¶
func (Dimensions) Name() string
type RigidBody ¶
type RigidBody struct { Acceleration Velocity ray.Vector3 }
RigidBody is an entity with a solid body in which deformation is zero or so small it can be neglected. The distance between any two given points on a rigid body remains constant in time regardless of external forces exerted on it.
type Rotation ¶
type Rotation struct {
X, Y, Z int32
}
Rotation describes an entity's angle transformation.
type Scriptable ¶
func (Scriptable) Name ¶
func (Scriptable) Name() string