class Entitas::Matcher

Included Modules

Defined in:

entitas.cr
entitas/generators/matcher.cr
entitas/matcher.cr
entitas/matcher/group_events.cr

Constant Summary

Log = ::Log.for(self)

Constructors

Instance Method Summary

Macro Summary

Instance methods inherited from module Entitas::IAllOfMatcher

any_of(*indices : Int32) : IAnyOfMatcher
any_of(*matchers : IMatcher) : IAnyOfMatcher
any_of(*comps : Entitas::Component::ComponentTypes) : IAnyOfMatcher
any_of(*indices : Entitas::Component::Index) : IAnyOfMatcher
any_of

Instance methods inherited from module Entitas::IAnyOfMatcher

none_of(*indices : Int32) : INoneOfMatcher
none_of(*matchers : IMatcher) : INoneOfMatcher
none_of(*comps : Entitas::Component::ComponentTypes) : INoneOfMatcher
none_of(*indices : Entitas::Component::Index) : INoneOfMatcher
none_of

Instance methods inherited from module Entitas::ICompoundMatcher

all_of_indices : Set(Entitas::Component::Index) all_of_indices, any_of_indices : Set(Entitas::Component::Index) any_of_indices, none_of_indices : Set(Entitas::Component::Index) none_of_indices

Instance methods inherited from module Entitas::IMatcher

indices : Set(Entitas::Component::Index) indices, matches?(entity : Entitas::Entity) : Bool matches?

Constructor Detail

def self.all_of(*comps : Entitas::Component::ComponentTypes) : Matcher #

class ::Entitas::Matcher Create a matcher to match entities with "ALL" of the provided Entitas::Component classes

Entitas::Matcher.all_of(A, B)

def self.all_of(*indices : Int32) : Matcher #

Create a matcher to match entities that have "ALL" of the Entitas::Component classes in the provided Int32 indexs to merge

Entitas::Matcher.all_of(0)

def self.all_of(*indices : Entitas::Component::Index) : Matcher #

Create a matcher to match entities that have "ALL" of the Entitas::Component classes in the provided Entitas::Component::Index indices to merge

Entitas::Matcher.all_of(Entitas::Component::Index::A)

def self.all_of(*matchers : Matcher) : Matcher #

Create a matcher to match entities that have "ALL" of the Entitas::Component classes in the provided Entitas::Matcher instances to merge

m1 = Entitas::Matcher.all_of(A)
m2 = Entitas::Matcher.all_of(B)
matcher = Entitas::Matcher.all_of(m1, m2)

def self.any_of(*comps : Entitas::Component::ComponentTypes) : Matcher #

Create a matcher to match entities with "ANY" of the provided Entitas::Component classes

Entitas::Matcher.any_of(A, B)

def self.any_of(*indices : Int32) : Matcher #

Create a matcher to match entities that have "ANY" of the Entitas::Component classes in the provided Int32 indexs to merge

Entitas::Matcher.any_of(0)

def self.any_of(*indices : Entitas::Component::Index) : Matcher #

Create a matcher to match entities that have "ANY" of the Entitas::Component classes in the provided Entitas::Component::Index indices to merge

Entitas::Matcher.any_of(Entitas::Component::Index::A)

def self.any_of(*matchers : Matcher) : Matcher #

Create a matcher to match entities that have "ANY" of the Entitas::Component classes in the provided Entitas::Matcher instances to merge

m1 = Entitas::Matcher.any_of(A)
m2 = Entitas::Matcher.any_of(B)
matcher = Entitas::Matcher.any_of(m1, m2)

def self.new(component_names : Array(String) = Array(String).new) #

[View source]
def self.none_of(*comps : Entitas::Component::ComponentTypes) : Matcher #

Create a matcher to match entities with "NONE" of the provided Entitas::Component classes

Entitas::Matcher.none_of(A, B)

def self.none_of(*indices : Int32) : Matcher #

Create a matcher to match entities that have "NONE" of the Entitas::Component classes in the provided Int32 indexs to merge

Entitas::Matcher.none_of(0)

def self.none_of(*indices : Entitas::Component::Index) : Matcher #

Create a matcher to match entities that have "NONE" of the Entitas::Component classes in the provided Entitas::Component::Index indices to merge

Entitas::Matcher.none_of(Entitas::Component::Index::A)

def self.none_of(*matchers : Matcher) : Matcher #

Create a matcher to match entities that have "NONE" of the Entitas::Component classes in the provided Entitas::Matcher instances to merge

m1 = Entitas::Matcher.none_of(A)
m2 = Entitas::Matcher.none_of(B)
matcher = Entitas::Matcher.none_of(m1, m2)

Instance Method Detail

def ==(other : Matcher) #

Equality. Returns true if each element in self is equal to each corresponding element in other.


[View source]

[View source]
def added_or_removed : Entitas::Events::TriggerOn #

[View source]

Create a matcher to match entities with "ALL" of the provided Entitas::Component classes

Entitas::Matcher.new.all_of(A, B)

def all_of(*indices : Int32) : IAllOfMatcher #

Create a matcher to match entities that have "ALL" of the Entitas::Component classes in the provided Int32 indices to merge

Entitas::Matcher.new.all_of(0)

def all_of(*indices : Entitas::Component::Index) : IAllOfMatcher #

Create a matcher to match entities that have "ALL" of the Entitas::Component classes in the provided Entitas::Component::Index indices to merge

Entitas::Matcher.new.all_of(Entitas::Component::Index::A)

def all_of(*matchers : IMatcher) : IAllOfMatcher #

Create a matcher to match entities that have "ALL" of the Entitas::Component classes in the provided Entitas::Matcher instances to merge

m1 = Entitas::Matcher.new.all_of(A)
m2 = Entitas::Matcher.new.all_of(B)
matcher = Entitas::Matcher.new.all_of(m1, m2)

Create a matcher to match entities with "ANY" of the provided Entitas::Component classes

Entitas::Matcher.new.any_of(A, B)

def any_of(*indices : Int32) : IAnyOfMatcher #

Create a matcher to match entities that have "ANY" of the Entitas::Component classes in the provided Int32 indices to merge

Entitas::Matcher.new.any_of(0)

def any_of(*indices : Entitas::Component::Index) : IAnyOfMatcher #

Create a matcher to match entities that have "ANY" of the Entitas::Component classes in the provided Entitas::Component::Index indices to merge

Entitas::Matcher.new.any_of(Entitas::Component::Index::A)

def any_of(*matchers : IMatcher) : IAnyOfMatcher #

Create a matcher to match entities that have "ANY" of the Entitas::Component classes in the provided Entitas::Matcher instances to merge

m1 = Entitas::Matcher.new.any_of(A)
m2 = Entitas::Matcher.new.any_of(B)
matcher = Entitas::Matcher.new.any_of(m1, m2)

def component_names : Array(String) #

[View source]
def component_names=(component_names : Array(String)) #

[View source]
def indices : Set(Entitas::Component::Index) #

[View source]
def matches?(entity : Entitas::Entity) : Bool #

[View source]

Create a matcher to match entities with "NONE" of the provided Entitas::Component classes

Entitas::Matcher.new.none_of(A, B)

def none_of(*indices : Int32) : INoneOfMatcher #

Create a matcher to match entities that have "NONE" of the Entitas::Component classes in the provided Int32 indices to merge

Entitas::Matcher.new.none_of(0)

def none_of(*indices : Entitas::Component::Index) : INoneOfMatcher #

Create a matcher to match entities that have "NONE" of the Entitas::Component classes in the provided Entitas::Component::Index indices to merge

Entitas::Matcher.new.none_of(Entitas::Component::Index::A)

def none_of(*matchers : IMatcher) : INoneOfMatcher #

Create a matcher to match entities that have "NONE" of the Entitas::Component classes in the provided Entitas::Matcher instances to merge

m1 = Entitas::Matcher.new.none_of(A)
m2 = Entitas::Matcher.new.none_of(B)
matcher = Entitas::Matcher.new.none_of(m1, m2)


[View source]
def to_json(json : JSON::Builder) #

[View source]
def to_s(io) #

[View source]

Macro Detail

macro gen_functions #

[View source]