ExtensionMethodsDSL

class Object
trait Matchable
class Any

Extensions

Extensions

extension (component: A)
def and[A <: Component](rightComponent: B)(using entity: Entity)(implicit evidence$4: ComponentTag[A], ct: ComponentTag[B]): ComponentWrapper

This method adds the current component and its agrument to an entity and enables the following syntax:

This method adds the current component and its agrument to an entity and enables the following syntax:

entity withComponents {

 Component1() and Component2()

}
Value Params
rightComponent

The component to be added to an entity.

Returns

A ComponentWrapper that enables the components chaining.

extension (entity: Entity)
def +(component: C)(implicit evidence$2: ComponentTag[C]): Entity

This method enables the following syntax:

This method enables the following syntax:

entity + Component()
def -(component: C)(implicit evidence$3: ComponentTag[C]): Entity

This method enables the following syntax:

This method enables the following syntax:

entity - Component()
def withComponent(component: C)(implicit evidence$1: ComponentTag[C]): Entity

This method enables the following syntax:

This method enables the following syntax:

entity withComponent Component()
def withComponents(init: Entity => Unit): Entity

This method enables the following syntax:

This method enables the following syntax:

entity withComponents {

 Component1() and Component2()

}
extension (world: World)
def hasAn(entityWord: EntityWord): Entity

This method enables the following syntax:

This method enables the following syntax:

world hasAn entity