private void ResetColourData_Click(object sender, RoutedEventArgs e) { MapConf.SetDefaultColours(); ColoursPropertyGrid.SelectedObject = MapConf.ActiveColourScheme; RegionUC.ReDrawMap(true); UniverseUC.ReDrawMap(true, true, true); }
/// <summary> /// 地图块赋值 /// </summary> private void CreateMap() { List <MapConf> mstr = GetMap(); map = new int[row, col]; for (int i = 0; i < row / 10; i++) { for (int j = 0; j < col / 10; j++) { if (i == 0 && j == 0) { continue; } System.Random random = new System.Random(i * j * DateTime.Now.Millisecond); int r = random.Next(mstr.Count - 1); MapConf mapConf = mstr[r]; mstr.Remove(mapConf); string[] mapstr = mapConf.map.Split(';'); List <string[]> m = new List <string[]>(); for (int strl = 0; strl < mapstr.Length; strl++) { string[] mastr = mapstr[strl].Split(','); m.Add(mastr); } for (int a = 0; a < 10; a++) { for (int b = 0; b < 10; b++) { map[i * 10 + a, j * 10 + b] = int.Parse(m[a][b]); } } } } }
private void ResetColourData_Click(object sender, RoutedEventArgs e) { MapConf.MapColours = new List <MapColours>(); MapConf.SetDefaultColours(); ColourListDropdown.ItemsSource = MapConf.MapColours; ColourListDropdown.SelectedItem = MapConf.MapColours[0]; RegionRC.ReDrawMap(); }
public void Load() { datas.Clear(); dataMap.Clear(); datas = ConfigManager.Load <MapConf>(); for (int i = 0; i < datas.Count; i++) { MapConf conf = datas[i]; dataMap.Add(conf.id, datas[i]); } }
public static MazeMapManager CreateMapManager(MapConf conf) { return(CreateMapManager((MapType)conf.type, conf.group, conf.row, conf.col)); }