Ejemplo n.º 1
0
        public static bool Matches(IEntityOld entity, ByteFlag components, EntityMatchesOld match = EntityMatchesOld.All)
        {
            bool matches = false;

            switch (match)
            {
            case EntityMatchesOld.All:
                matches = MatchesAll(entity, components);
                break;

            case EntityMatchesOld.Any:
                matches = MatchesAny(entity, components);
                break;

            case EntityMatchesOld.None:
                matches = !MatchesAny(entity, components);
                break;

            case EntityMatchesOld.Exact:
                matches = MatchesExact(entity, components);
                break;
            }

            return(matches);
        }
Ejemplo n.º 2
0
        public static bool Matches(ByteFlag groups1, ByteFlag groups2, EntityMatchesOld match = EntityMatchesOld.All)
        {
            bool matches = false;

            switch (match)
            {
            case EntityMatchesOld.All:
                matches = MatchesAll(groups1, groups2);
                break;

            case EntityMatchesOld.Any:
                matches = MatchesAny(groups1, groups2);
                break;

            case EntityMatchesOld.None:
                matches = !MatchesAny(groups1, groups2);
                break;

            case EntityMatchesOld.Exact:
                matches = MatchesExact(groups1, groups2);
                break;
            }

            return(matches);
        }
Ejemplo n.º 3
0
        EntityMatchGroup GetMatchGroup(EntityMatchesOld match)
        {
            var matchGroup = subGroups[(int)match];

            if (matchGroup == null)
            {
                matchGroup            = new EntityMatchGroup(this, match);
                subGroups[(int)match] = matchGroup;
            }

            return(matchGroup);
        }
Ejemplo n.º 4
0
        public static bool Matches(ByteFlag groups1, ByteFlag groups2, EntityMatchesOld match = EntityMatchesOld.All)
        {
            bool matches = false;

            switch (match)
            {
                case EntityMatchesOld.All:
                    matches = MatchesAll(groups1, groups2);
                    break;
                case EntityMatchesOld.Any:
                    matches = MatchesAny(groups1, groups2);
                    break;
                case EntityMatchesOld.None:
                    matches = !MatchesAny(groups1, groups2);
                    break;
                case EntityMatchesOld.Exact:
                    matches = MatchesExact(groups1, groups2);
                    break;
            }

            return matches;
        }
Ejemplo n.º 5
0
        public static bool Matches(IEntityOld entity, ByteFlag components, EntityMatchesOld match = EntityMatchesOld.All)
        {
            bool matches = false;

            switch (match)
            {
                case EntityMatchesOld.All:
                    matches = MatchesAll(entity, components);
                    break;
                case EntityMatchesOld.Any:
                    matches = MatchesAny(entity, components);
                    break;
                case EntityMatchesOld.None:
                    matches = !MatchesAny(entity, components);
                    break;
                case EntityMatchesOld.Exact:
                    matches = MatchesExact(entity, components);
                    break;
            }

            return matches;
        }
Ejemplo n.º 6
0
 public EntityMatchOld(ByteFlag groups, EntityMatchesOld match = EntityMatchesOld.All)
 {
     this.groups = groups;
     this.match = match;
 }
Ejemplo n.º 7
0
 public static IEntityGroupOld GetEntityGroup(Type[] componentTypes, EntityMatchesOld match = EntityMatchesOld.All)
 {
     return(masterGroup.Filter(componentTypes, match));
 }
Ejemplo n.º 8
0
 public static IEntityGroupOld GetEntityGroup(ByteFlag groups, EntityMatchesOld match = EntityMatchesOld.All)
 {
     return(masterGroup.Filter(groups, match));
 }
Ejemplo n.º 9
0
 public IEntityGroupOld Filter(Type[] componentTypes, EntityMatchesOld match = EntityMatchesOld.All)
 {
     return(GetMatchGroup(match).GetGroupByComponentGroup(EntityUtility.GetComponentFlags(componentTypes)));
 }
Ejemplo n.º 10
0
 public IEntityGroupOld Filter(ByteFlag groups, EntityMatchesOld match = EntityMatchesOld.All)
 {
     return(GetMatchGroup(match).GetGroupByEntityGroup(groups));
 }
Ejemplo n.º 11
0
 public EntityMatchGroup(IEntityGroupOld parent, EntityMatchesOld match)
 {
     this.parent = parent;
     this.match  = match;
 }
Ejemplo n.º 12
0
 public EntityMatchOld(ByteFlag groups, EntityMatchesOld match = EntityMatchesOld.All)
 {
     this.groups = groups;
     this.match  = match;
 }
Ejemplo n.º 13
0
 public EntityMatchGroup(IEntityGroupOld parent, EntityMatchesOld match)
 {
     this.parent = parent;
     this.match = match;
 }