Add() public method

public Add ( IntVector3 p ) : void
p IntVector3
return 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);
        }