Ejemplo n.º 1
0
        public List <Coordinate> GetAllNeighbours(string[,] map)
        {
            List <Coordinate> directions = new List <Coordinate>();

            directions.Add(new Coordinate(1, 0));
            directions.Add(new Coordinate(-1, 0));
            directions.Add(new Coordinate(0, 1));
            directions.Add(new Coordinate(0, -1));
            List <Coordinate> returnList = new List <Coordinate>();

            foreach (Coordinate d in directions)
            {
                Coordinate neighbour = LocalPosition.GetSum(d);
                if (neighbour.IsInPositiveBounds(map.GetLength(0), map.GetLength(1)))
                {
                    returnList.Add(neighbour);
                }
            }
            return(returnList);
        }
Ejemplo n.º 2
0
 public Coordinate getBottomRight()
 {
     return(Position.GetSum(Size));
 }