예제 #1
0
        public static bool Matches(EntityGroups groups1, EntityGroups groups2, EntityMatches match = EntityMatches.All)
        {
            bool matches = false;

            switch (match)
            {
            case EntityMatches.All:
                matches = groups1.HasAll(groups2);
                break;

            case EntityMatches.Any:
                matches = groups1.HasAny(groups2);
                break;

            case EntityMatches.None:
                matches = groups1.HasNone(groups2);
                break;

            case EntityMatches.Exact:
                matches = groups1 == groups2;
                break;
            }

            return(matches);
        }
예제 #2
0
        public IEntity CreateEntity(EntityGroups groups, bool active)
        {
            Assert.IsNotNull(groups);

            var entity = entityPool.Create();

            entity.Initialize(this, messageManager, groups, active);
            AddEntity(entity);

            return(entity);
        }
예제 #3
0
 public IEntity CreateEntity(EntityGroups groups)
 {
     return(CreateEntity(groups, true));
 }
예제 #4
0
 public EntityMatch(EntityGroups groups, EntityMatches match = EntityMatches.All)
 {
     this.groups = groups;
     this.match  = match;
 }