module Oid::Components::Position::Helper

Direct including types

Defined in:

Instance Method Summary

Instance Method Detail

def add_component_position : Entitas::Entity #

Add a Oid::Components::Position to the entity. Returns self to allow chainables

entity.add_component_position

def add_component_position(**args) : Entitas::Entity #

Add a Oid::Components::Position to the entity. Returns self to allow chainables

entity.add_component_position

def add_position(value : Oid::Vector3 = Oid::Vector3.zero) : Entitas::Entity #

Add a Oid::Components::Position to the entity. Returns self to allow chainables

entity.add_position(1)

def add_position_listener(value : Oid::Components::Position::Listener) #

def del_component_position : Entitas::Entity #

Delete Oid::Components::Position from the entity. Returns self to allow chainables

entity.del_position
entity.position # => nil

def del_position : Entitas::Entity #

Delete Oid::Components::Position from the entity. Returns self to allow chainables

entity.del_position
entity.position # => nil

def get_component_position : Oid::Components::Position #

Will return the component that is a Oid::Components::Position or raise


def has_component_position? : Bool #

Will return true if the entity has an component Oid::Components::Position or false if it does not


def has_position? : Bool #

Will return true if the entity has an component Oid::Components::Position or false if it does not


def position : Oid::Components::Position #

Will return the component that is a Oid::Components::Position or raise


def position? : Bool #

Alias. See #has_position?


def remove_component_position #

Append. Alias for #del_component_position


def remove_position #

Append. Alias for #del_position


def remove_position_listener(value : Oid::Components::Position::Listener, remove_comp_when_empty = false) #

def replace_component_position(component : Oid::Components::Position) #

Append. Alias for #replace_position


def replace_component_position(**args) #

Will replace the current component with the new one generated from the provided arguments

entity.replace_position
entity.get_position # => (new_comp)

def replace_position(value : Oid::Vector3) #

Will replace the current component with the new one generated from the provided arguments

entity.replace_position(value: 1)
entity.get_position # => (new_comp)

or

entity.replace_position(1)
entity.get_position # => (new_comp)

def replace_position(component : Oid::Components::Position) #

Will replace the current component with the new one provided

entity.replace_component_position(new_comp)
entity.get_position # => (new_comp)