public void Save() { MapRecord record = new MapRecord(_row, _column); for (int i = 0; i < _row; i++) { for (int j = 0; j < _column; j++) { MapGrid mapGrid = _mapGridArray[GetIndex(i, j, _column)]; record.SetSelect(i, j, mapGrid.Select ? MapDefine.SELECT : MapDefine.UNSELECT); } } using (StreamWriter sw = new StreamWriter(MapDefine.MAP_DATA_PATH)) { sw.Write(JsonMapper.ToJson(record)); } }