private void InitializeResults()
        {
            results = new MatchupResult[agents.Length, agents.Length, decks.Length, decks.Length];
            for (int player_1 = 0; player_1 < results.GetLength(0); player_1++)
            {
                for (int player_2 = 0; player_2 < results.GetLength(1); player_2++)
                {
                    if (player_1 == player_2)
                    {
                        continue;
                    }

                    for (int deck_1 = 0; deck_1 < results.GetLength(2); deck_1++)
                    {
                        for (int deck_2 = 0; deck_2 < results.GetLength(3); deck_2++)
                        {
                            results[player_1, player_2, deck_1, deck_2] = new MatchupResult();
                        }
                    }
                }
            }
        }
예제 #2
0
        private void InitializeResults()
        {
            results = new MatchupResult[agents.Length, agents.Length, decks.Length, decks.Length];
            for (int player_1 = 0; player_1 < results.GetLength(0); player_1++)
            {
                for (int player_2 = 0; player_2 < results.GetLength(1); player_2++)
                {
                    if (player_1 == player_2)
                    {
                        continue;
                    }

                    for (int deck_1 = 0; deck_1 < results.GetLength(2); deck_1++)
                    {
                        for (int deck_2 = 0; deck_2 < results.GetLength(3); deck_2++)
                        {
                            results[player_1, player_2, deck_1, deck_2] = new MatchupResult();
                        }
                    }
                }
            }

            if (resultfile != null && File.Exists(resultfile))
            {
                LoadPreviousResults(resultfile);
            }


            if (!File.Exists(resultfile))
            {
                // Create a file to write to.
                using (StreamWriter sw = File.CreateText(resultfile))
                {
                }
            }
            WriteCurrentStateToFile();
        }