/// <summary> /// Called by GameMenuPage when Start (AI) is clicked. /// This is the start of the AI mode, and will start the first generation /// </summary> public void StartGame(bool loadLastSave = false) { ResetWeightsAndScore(); _isRunning = true; InitShips(); _interface.ShowAIUI(); if (loadLastSave) { try { var ship = ShipInfo.LoadFromFile(); _bestWeights = ship.Weights; _bestWeightGeneration = ship.Generation; _bestWeightScore = ship.HighScore; } catch {} } SetHighScore(_bestWeightScore, _bestWeightGeneration); StartGeneration(_bestWeightGeneration + 1); }