public static IEnumerable <Area> TargetsToCompareAreaList(ITargetSelector targetToCompare, DynamicValueContext context)
        {
            IEntitySelector entitySelector = targetToCompare as IEntitySelector;

            if (entitySelector != null)
            {
                foreach (IEntity item in entitySelector.EnumerateEntities(context))
                {
                    IEntityWithBoardPresence entityWithBoardPresence = item as IEntityWithBoardPresence;
                    if (entityWithBoardPresence != null)
                    {
                        yield return(entityWithBoardPresence.area);
                    }
                }
            }
            ICoordSelector coordSelector = targetToCompare as ICoordSelector;

            if (coordSelector != null)
            {
                foreach (Coord item2 in coordSelector.EnumerateCoords(context))
                {
                    yield return(new PointArea((Vector2Int)item2));
                }
            }
        }
Пример #2
0
 private static IEnumerable <Target> EnumerateCompanionAvailableLocations(ICoordSelector spawnLocation, CastTargetContext castTargetContext)
 {
     foreach (Coord item in spawnLocation.EnumerateCoords(castTargetContext))
     {
         yield return(new Target(item));
     }
 }
Пример #3
0
        public IEnumerable <Vector2Int> EnumerateInstantiationPositions([NotNull] DynamicValueContext castTargetContext)
        {
            ICoordSelector coordSelector = m_originTarget as ICoordSelector;

            if (coordSelector != null)
            {
                foreach (Coord item in coordSelector.EnumerateCoords(castTargetContext))
                {
                    yield return(new Vector2Int(item.x, item.y));
                }
            }
        }
Пример #4
0
        public override IEnumerable <Coord> EnumerateCoords(DynamicValueContext context)
        {
            HashSet <Coord> coordsSet = new HashSet <Coord>();

            foreach (Coord c in m_first.EnumerateCoords(context))
            {
                yield return(c);

                coordsSet.Add(c);
            }
            foreach (Coord item in m_second.EnumerateCoords(context))
            {
                if (coordsSet.Add(item))
                {
                    yield return(item);
                }
            }
        }