ecs

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: GPL-3.0 Imports: 3 Imported by: 2

README

ecs

Implementation of ECS pattern

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEntity

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

BaseEntity contains required fields

func NewBaseEntity

func NewBaseEntity() *BaseEntity

NewBaseEntity return new entity

func NewBaseEntityWithID

func NewBaseEntityWithID(id uint64) *BaseEntity

NewBaseEntityWithID return new entity with id

func (*BaseEntity) GetID

func (e *BaseEntity) GetID() uint64

GetID return id

func (*BaseEntity) GetVersion

func (e *BaseEntity) GetVersion() uint64

GetVersion return current version of object

func (*BaseEntity) SetID

func (e *BaseEntity) SetID(id uint64)

SetID set id

func (*BaseEntity) SetVersion

func (e *BaseEntity) SetVersion(v uint64)

SetVersion set current version

func (*BaseEntity) UpVersion

func (e *BaseEntity) UpVersion()

UpVersion increase current version

type Component

type Component interface {
	Update(ctx context.Context) error
}

Component is an interface which implements an ECS-System

type Entity

type Entity interface {
	GetID() uint64
}

Entity describe entity

type System

type System interface {
	Update(ctx context.Context) error
}

System is an interface which implements an ECS-System

type Versionable

type Versionable interface {
	GetVersion() uint64
	UpVersion()
}

Versionable describe version for entity

Jump to

Keyboard shortcuts

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