public Training(Models.GameConfiguration gc) { InitializeComponent(); stopped = false; this.gc = gc; Btn_StopTraining.IsEnabled = false; }
public MainWindow() { InitializeComponent(); gc = new Models.GameConfiguration(); menu = new MainMenu(gc); Content = menu; }
public GamePage(Models.GameConfiguration gc, Game game) { InitializeComponent(); this.game = game; this.gc = gc; }
private void Btn_LoadConfig_Click(object sender, RoutedEventArgs e) { var openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Json file (*.json)|*.json"; if (openFileDialog.ShowDialog() == true) { Models.GameConfiguration gc = Models.GameConfiguration.FromJson(File.ReadAllText(openFileDialog.FileName)); SetConfiguration(gc); } }
public void SetConfiguration(Models.GameConfiguration gc) { NeuronCount.Value = gc.NeuronCount; LayerCount.Value = gc.LayerCount; MemoryNeuronCount.Value = gc.MemoryNeuronCount; BaseEvolutionFactor.Value = gc.BaseEvolutionFactor; NumberOfAIs.Value = gc.NumberOfAIs; KeepBestAIs.Value = gc.KeepBestAIs; MaximumChildren.Value = gc.MaximumChildrenPerAi; GameLength.Value = gc.GameLength; SaveBestAIAfterEveryRound.IsChecked = gc.SaveBestAIAfterEveryRound; SaveBestAIAfterStoppingSim.IsChecked = gc.SaveBestAIAfterStoppingSim; InitialBallSpeed.Value = gc.InitialBallSpeed; BallSpeedIncrement.Value = gc.BallSpeedIncrement; PaddleSpeed.Value = gc.PaddleSpeed; }
public Models.GameConfiguration GetGameConfiguration() { Models.GameConfiguration gc = new Models.GameConfiguration() { NeuronCount = (int)NeuronCount.Value, LayerCount = (int)LayerCount.Value, MemoryNeuronCount = (int)MemoryNeuronCount.Value, BaseEvolutionFactor = (int)BaseEvolutionFactor.Value, NumberOfAIs = (uint)NumberOfAIs.Value, KeepBestAIs = (uint)KeepBestAIs.Value, MaximumChildrenPerAi = (uint)MaximumChildren.Value, GameLength = (int)GameLength.Value, SaveBestAIAfterEveryRound = (bool)SaveBestAIAfterEveryRound.IsChecked, SaveBestAIAfterStoppingSim = (bool)SaveBestAIAfterStoppingSim.IsChecked, InitialBallSpeed = (float)InitialBallSpeed.Value, BallSpeedIncrement = (float)BallSpeedIncrement.Value, PaddleSpeed = (float)PaddleSpeed.Value }; return(gc); }
public MainMenu(Models.GameConfiguration gc) { InitializeComponent(); this.gc = gc; }
public GameConfiguration(Models.GameConfiguration gc) { InitializeComponent(); SetConfiguration(gc); }
public PlayGame(Models.GameConfiguration gc) { InitializeComponent(); this.gc = gc; }