⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 map.cs

📁 A .NET Path Finder Library Path Finder Library is a .NET library that currently contains one type c
💻 CS
字号:
using System;

namespace HenizeSoftware
{
  namespace PathFinding
  {
    class Map
    {
      bool[,] map;

      public Map(ushort x, ushort y)
      {
        map = new bool[x, y];
      }

      public Map(ushort x, ushort y, Coordinate[] unwalkableNodes)
        : this(x, y)
      {
        if (unwalkableNodes == null)
          return;
        foreach (Coordinate c in unwalkableNodes)
        {
          map[c.X, c.Y] = true;
        }
      }

      public bool this[ushort x, ushort y]
      {
        get 
        { 
          return (!(x >= 0 && x <= map.GetUpperBound(0) && y >= 0 && y <= map.GetUpperBound(1)) || map[x, y]); 
        }
        set
        {
          map[x, y] = value;
        }
      }
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -