private void SetWidgetData(GamePreset gp) { for (int i = 0; i < gp.Races.Length; i++) { widgets[i].PlayerType = gp.PlayerTypes[i]; widgets[i].Race = gp.Races[i]; widgets[i].Scheme = gp.Colors[i]; } game.LoadScreen.ImageFile = gp.LoadImage; textGTController.Text = gp.GameType; textMap.Text = gp.Map; gp.InputTypes.CopyTo(inputTypes, 0); gp.InputInitArgs.CopyTo(inputInitArgs, 0); }
public override void Build() { gPresets = new List <GamePreset>(); inputTypes = new string[GameState.MAX_PLAYERS]; inputInitArgs = new object[GameState.MAX_PLAYERS]; var di = new DirectoryInfo(PRESET_DIR); foreach (var fi in di.GetFiles()) { if (!fi.Extension.EndsWith(@"game")) { continue; } GamePreset gp = (GamePreset)ZXParser.ParseFile(fi.FullName, typeof(GamePreset)); gPresets.Add(gp); } }