System

trait System[L <: CList](using clt: CListTag[L])

Represent a way to iterate over entities with specific components (given by the type parameter L) and manupulate them.

Type Params
L

a CList representing the Components available to the System.

class Object
trait Matchable
class Any
trait ExcludingSystem[LIncluded, LExcluded]

Value members

Abstract methods

def update(entity: Entity, components: L)(deltaTime: DeltaTime, world: World, view: View[L]): Deletable[L]

Describes how this System updates the components (described by the type of the System) of an Entity.

Describes how this System updates the components (described by the type of the System) of an Entity.

Value Params
components

the CList of Components that are being updated.

deltaTime

the delta time used to update.

entity

the Entity whose components are being updated.

view

the View of all entities with the components described by L.

world

the World in which this System is being used.

Returns

a new CList with the updated components; it could also contain a special component - Deleted - that is used to delete the corresponding component: e.g. If the expected return type is a

Position &: Velocity &: CNil

one could also return

Position(1, 2) &: Deleted &: CNil

from the given Entity.

Concrete methods

def after(deltaTime: DeltaTime, world: World, view: View[L]): Unit

This method is executed after each iteration of the System.

This method is executed after each iteration of the System.

Value Params
deltaTime

the delta time used to update.

view

a View with the Components specified by the System type.

world

the World in which the System is being executed.

def before(deltaTime: DeltaTime, world: World, view: View[L]): Unit

This method is executed before each iteration of the System.

This method is executed before each iteration of the System.

Value Params
deltaTime

the delta time used to update.

view

a View with the Components specified by the System type.

world

the World in which the System is being executed.

protected def getView(world: World): View[L]
def shouldRun: Boolean
Returns

wether this System should be executed or not.