class Entitas::Matcher
- Entitas::Matcher
- Reference
- Object
Included Modules
Defined in:
entitas.crentitas/generators/matcher.cr
entitas/matcher.cr
entitas/matcher/group_events.cr
Constant Summary
-
Log =
::Log.for(self)
Constructors
-
.all_of(*comps : Entitas::Component::ComponentTypes) : Matcher
class ::Entitas::Matcher Create a matcher to match entities with "ALL" of the provided
Entitas::Component
classes -
.all_of(*indices : Int32) : Matcher
Create a matcher to match entities that have "ALL" of the
Entitas::Component
classes in the providedInt32
indexs to merge -
.all_of(*indices : Entitas::Component::Index) : Matcher
Create a matcher to match entities that have "ALL" of the
Entitas::Component
classes in the providedEntitas::Component::Index
indices to merge -
.all_of(*matchers : Matcher) : Matcher
Create a matcher to match entities that have "ALL" of the
Entitas::Component
classes in the providedEntitas::Matcher
instances to merge -
.any_of(*comps : Entitas::Component::ComponentTypes) : Matcher
Create a matcher to match entities with "ANY" of the provided
Entitas::Component
classes -
.any_of(*indices : Int32) : Matcher
Create a matcher to match entities that have "ANY" of the
Entitas::Component
classes in the providedInt32
indexs to merge -
.any_of(*indices : Entitas::Component::Index) : Matcher
Create a matcher to match entities that have "ANY" of the
Entitas::Component
classes in the providedEntitas::Component::Index
indices to merge -
.any_of(*matchers : Matcher) : Matcher
Create a matcher to match entities that have "ANY" of the
Entitas::Component
classes in the providedEntitas::Matcher
instances to merge - .new(component_names : Array(String) = Array(String).new)
-
.none_of(*comps : Entitas::Component::ComponentTypes) : Matcher
Create a matcher to match entities with "NONE" of the provided
Entitas::Component
classes -
.none_of(*indices : Int32) : Matcher
Create a matcher to match entities that have "NONE" of the
Entitas::Component
classes in the providedInt32
indexs to merge -
.none_of(*indices : Entitas::Component::Index) : Matcher
Create a matcher to match entities that have "NONE" of the
Entitas::Component
classes in the providedEntitas::Component::Index
indices to merge -
.none_of(*matchers : Matcher) : Matcher
Create a matcher to match entities that have "NONE" of the
Entitas::Component
classes in the providedEntitas::Matcher
instances to merge
Instance Method Summary
-
#==(other : Matcher)
Equality.
- #added : Entitas::Events::TriggerOn
- #added_or_removed : Entitas::Events::TriggerOn
-
#all_of(*comps : Entitas::Component::ComponentTypes) : IAllOfMatcher
Create a matcher to match entities with "ALL" of the provided
Entitas::Component
classes -
#all_of(*indices : Int32) : IAllOfMatcher
Create a matcher to match entities that have "ALL" of the
Entitas::Component
classes in the providedInt32
indices to merge -
#all_of(*indices : Entitas::Component::Index) : IAllOfMatcher
Create a matcher to match entities that have "ALL" of the
Entitas::Component
classes in the providedEntitas::Component::Index
indices to merge -
#all_of(*matchers : IMatcher) : IAllOfMatcher
Create a matcher to match entities that have "ALL" of the
Entitas::Component
classes in the providedEntitas::Matcher
instances to merge -
#any_of(*comps : Entitas::Component::ComponentTypes) : IAnyOfMatcher
Create a matcher to match entities with "ANY" of the provided
Entitas::Component
classes -
#any_of(*indices : Int32) : IAnyOfMatcher
Create a matcher to match entities that have "ANY" of the
Entitas::Component
classes in the providedInt32
indices to merge -
#any_of(*indices : Entitas::Component::Index) : IAnyOfMatcher
Create a matcher to match entities that have "ANY" of the
Entitas::Component
classes in the providedEntitas::Component::Index
indices to merge -
#any_of(*matchers : IMatcher) : IAnyOfMatcher
Create a matcher to match entities that have "ANY" of the
Entitas::Component
classes in the providedEntitas::Matcher
instances to merge - #component_names : Array(String)
- #component_names=(component_names : Array(String))
- #indices : Set(Entitas::Component::Index)
- #matches?(entity : Entitas::Entity) : Bool
-
#none_of(*comps : Entitas::Component::ComponentTypes) : INoneOfMatcher
Create a matcher to match entities with "NONE" of the provided
Entitas::Component
classes -
#none_of(*indices : Int32) : INoneOfMatcher
Create a matcher to match entities that have "NONE" of the
Entitas::Component
classes in the providedInt32
indices to merge -
#none_of(*indices : Entitas::Component::Index) : INoneOfMatcher
Create a matcher to match entities that have "NONE" of the
Entitas::Component
classes in the providedEntitas::Component::Index
indices to merge -
#none_of(*matchers : IMatcher) : INoneOfMatcher
Create a matcher to match entities that have "NONE" of the
Entitas::Component
classes in the providedEntitas::Matcher
instances to merge - #removed : Entitas::Events::TriggerOn
- #to_json(json : JSON::Builder)
- #to_s(io)
Macro Summary
Instance methods inherited from module Entitas::IAllOfMatcher
any_of(*indices : Int32) : IAnyOfMatcherany_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) : INoneOfMatchernone_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
class ::Entitas::Matcher
Create a matcher to match entities with "ALL" of the provided Entitas::Component
classes
Entitas::Matcher.all_of(A, B)
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)
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)
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)
Create a matcher to match entities with "ANY" of the provided Entitas::Component
classes
Entitas::Matcher.any_of(A, B)
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)
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)
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)
Create a matcher to match entities with "NONE" of the provided Entitas::Component
classes
Entitas::Matcher.none_of(A, B)
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)
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)
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
Equality. Returns true
if each element in self
is equal to each
corresponding element in other.
Create a matcher to match entities with "ALL" of the provided Entitas::Component
classes
Entitas::Matcher.new.all_of(A, B)
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)
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)
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)
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)
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)
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)
Create a matcher to match entities with "NONE" of the provided Entitas::Component
classes
Entitas::Matcher.new.none_of(A, B)
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)
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)
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)