コード例 #1
0
        // end the game and print the results
        void EndGame()
        {
            CurrentPlayer.SignalMatch(true);
            OtherPlayer.SignalMatch(false);

            AIDebug.MatchLog("========================");
            AIDebug.MatchLog("GAME " + (game_count + 1) + " RESULTS");
            AIDebug.MatchLog(Player1.Name + ":: Score: " + Player1.Score + " Victories: " + Player1.Victories);
            AIDebug.MatchLog(Player2.Name + ":: Score: " + Player2.Score + " Victories: " + Player2.Victories);

            //PrintTime ("Elapsed match time:");
            AIDebug.MatchLog("Average Turn Time: " + turn_times.Average);
            AIDebug.MatchLog("Total Turn Time: " + turn_times.Sum);

            game_count++;

            CurrentPlayer.ForgetRandom();
            OtherPlayer.ForgetRandom();

            if (game_count >= TRAINING_SESSION)
            {
                game_count = 0;

                EndTraining();
            }

            RestartGame();
        }
コード例 #2
0
        void AIDebugPrintDeck(bool reveal)
        {
            AIDebug.MatchLog("Deck State");

            int    row   = 0;
            string print = "";

            foreach (MemoryCard card in GameCards)
            {
                if (reveal || card.Played == true)
                {
                    print += "[" + card.Value + "] ";
                }
                else
                {
                    print += "[X] ";
                }
                row++;

                if (row >= 6)
                {
                    AIDebug.MatchLog(print);
                    print = "";
                    row   = 0;
                }
            }

            AIDebug.MatchLog("========================");
        }