示例#1
0
        private bool canAdd(Tile toadd, List<Tile> open, List<Tile> closed)
        {
            bool ret = false;
            if (DEBUG)
                Console.WriteLine("entered canAdd");

            if (toadd != null && !toadd.isObstacle() && !closed.Contains(toadd) && !open.Contains(toadd))
            {
                if(DEBUG)
                    Console.WriteLine("Can add (" + toadd.getMapX() + "," + toadd.getMapY() + ")");

                ret = true;
            }

            if (DEBUG)
                Console.WriteLine("exiting canAdd");

            return ret;
        }