Esempio n. 1
0
 public static List <Entity> FindChildrenFor(this Pool pool, Entity entity)
 {
     return(pool
            .GetEntities(GameMatcher.Child)
            .Where(x => x.child.ParentId == entity.id.Value)
            .ToList());
 }
Esempio n. 2
0
        public static Entity AddId(this Entity entity, Pool pool)
        {
            var identifiables = pool.GetEntities(GameMatcher.Id);
            var currentId     = identifiables.Any() ? identifiables.Max(x => x.id.Value) : 0;

            entity.AddId(currentId + 1);
            return(entity);
        }
Esempio n. 3
0
        public List <Entity> GetExitsForCurrentPuzzle()
        {
            var currentBossConnection = _pool.GetCurrentPuzzleArea().bossConnection;

            return(_pool
                   .GetEntities(GameMatcher.ExitGate)
                   .Where(x => x.bossConnection.BossId == currentBossConnection.BossId)
                   .ToList());
        }
Esempio n. 4
0
        public static void SafeDeleteAll(this Pool pool, IMatcher matcher = null, Func <Entity, bool> ignore = null)
        {
            IEnumerable <Entity> entities = matcher != null?pool.GetEntities(matcher) : pool.GetEntities();

            if (ignore != null)
            {
                entities = entities.Where(ignore);
            }
            entities.ForEach(x => x.IsDestroyed(true));
        }
Esempio n. 5
0
 public static Entity GetActiveBoss(this Pool pool)
 {
     try
     {
         return(pool
                .GetEntities(GameMatcher.Boss)
                .Single(x => !x.isDead));
     }
     catch (Exception)
     {
         return(null);
     }
 }
Esempio n. 6
0
        private void RemoveLoadedThisTurnOnCharacterMove(Pool pool)
        {
            var loadedTraps = pool.GetEntities(Matcher.AllOf(GameMatcher.SpikeTrap, GameMatcher.Loaded)).ToList();

            loadedTraps.ForEach(e => e.ReplaceLoaded(false));
        }
Esempio n. 7
0
        public static UnityEngine.Camera GetCamera(this Pool pool)
        {
            var cameras = pool.GetEntities(GameMatcher.Camera);

            return(cameras.SingleEntity().camera.Value);
        }
Esempio n. 8
0
 public static Entity GetHero(this Pool pool)
 {
     return(pool.GetEntities(GameMatcher.Hero).SingleOrDefault());
 }