예제 #1
0
        public void FromJson(GridJson json)
        {
            Version++;
            _tileSize = json.size;

            _width = json.heightMap.GetLength(0);
            _height = json.heightMap.GetLength(1);

            if (_width != json.tileMap.GetLength(0) || _height != json.tileMap.GetLength(1))
            {

            }

            _heightMap  = new GridObject<byte>(json.heightMap);
            _tileMap    = new GridObject<short>(json.tileMap);

            _visitedMap = new bool[_width, _height];
            _sightMap = null;
        }
예제 #2
0
 public static void ToFile(string file, GridJson grid)
 {
     string str = JsonConvert.SerializeObject(grid);
     File.WriteAllText(file, str);
 }