コード例 #1
0
        /// <summary>
        /// Show replay of the given agent.
        /// </summary>
        /// <param name="agentToShow"></param>
        /// <param name="geneticSettings"></param>
        public void ViewAgent(Agent agentToShow, GeneticSettings geneticSettings)
        {
            networkSettings = (geneticSettings.FitnessCalculator as SnakeFitnessCalculator).NetworkSettings;
            snakeSettings   = (geneticSettings.FitnessCalculator as SnakeFitnessCalculator).SnakeSettings;
            SnakeFitnessCalculator fitnessCalculator = geneticSettings.FitnessCalculator as SnakeFitnessCalculator;

            FitnessCalculatorRecording recording = fitnessCalculator.RecordCalculation(agentToShow);

            MilisecondsForm milisecondsForm = new MilisecondsForm();

            milisecondsForm.ShowDialog();
            speedMS = milisecondsForm.speedMS;

            ShowPlay(recording);
        }
コード例 #2
0
        private void OnCellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                int index = (int)dataGridView.Rows[e.RowIndex].Cells[0].Value;

                if (e.ColumnIndex == 4)
                {
                    PlaytestReplay replayer = new PlaytestReplay(playtestResults.TestResults[index].PlaytestRecorder);

                    MilisecondsForm milisecondsForm = new MilisecondsForm();
                    milisecondsForm.ShowDialog();
                    speedMS = milisecondsForm.speedMS;

                    replayer.ShowReplay(speedMS);
                }
            }
        }