module Entitas::Helper::Entities(TEntity)

Direct including types

Defined in:

entitas/helpers/entities.cr

Instance Method Summary

Instance Method Detail

def count : Int32 #

See #size


[View source]
def each(&block : TEntity -> Nil) #

[View source]
def get_entities #

Returns all entities which are currently in the context.


[View source]
def has_entity?(entity : TEntity) : Bool #

Determines whether the context has the specified entity.


[View source]
def size #

Returns the total number of TEntity in this Group


[View source]
def sort(&block : TEntity, TEntity -> U) : Array(TEntity) forall U #

Returns a new array with all elements sorted based on the comparator in the given block.

The block must implement a comparison between two elements a and b, where a < b returns -1, a == b returns 0, and a > b returns 1. The comparison operator <=> can be used for this.

a = [3, 1, 2]
b = a.sort { |a, b| b <=> a }

b # => [3, 2, 1]
a # => [3, 1, 2]

[View source]