Add() 공개 메소드

public Add ( IntVector3 p ) : void
p IntVector3
리턴 void
예제 #1
0
        public ItemObject GetReachableItemByDistance(IntPoint3 location, IItemFilter filter,
			Unreachables unreachables)
        {
            var items = m_items
                .Where(i => i.IsReserved == false && i.IsInstalled == false && unreachables.IsUnreachable(i.Location) == false)
                .Where(i => filter.Match(i))
                .OrderBy(i => (i.Location - location).ManhattanLength);

            foreach (var item in items)
            {
                var found = AStar.AStarFinder.CanReach(m_env, location, item.Location, DirectionSet.Exact);

                if (found)
                    return item;

                unreachables.Add(item.Location);
            }

            return null;
        }
예제 #2
0
        public ItemObject GetReachableItemByDistance(IntVector3 location, IItemFilter filter,
                                                     Unreachables unreachables)
        {
            var items = m_items
                        .Where(i => i.IsReserved == false && i.IsInstalled == false && unreachables.IsUnreachable(i.Location) == false)
                        .Where(i => filter.Match(i))
                        .OrderBy(i => (i.Location - location).ManhattanLength);

            foreach (var item in items)
            {
                var found = AStar.CanReach(m_env, location, item.Location, DirectionSet.Exact);

                if (found)
                {
                    return(item);
                }

                unreachables.Add(item.Location);
            }

            return(null);
        }