Beispiel #1
0
        public TestScenario(PlayerRoundList pmr) : base("test-scenario", pmr, RoundFactory)
        {
            AllDone      = false;
            s_numPlayers = 0;

            GameMessages.SetCallback <GameRound>(GameMessages.Kind.RoundEnd, delegate(GameRound gr) {
                m_numRounds++;
                if (m_numRounds > 10)
                {
                    AllDone = true;
                }
            });
        }
Beispiel #2
0
        public TestInput()
        {
            GameMessages.SetCallback <GameSession>(GameMessages.Kind.GameBegin, delegate(GameSession s)
            {
                GameTotal++;
                GameCount++;
                lastGameSession = s;
            });
            GameMessages.SetCallback <GameSession>(GameMessages.Kind.GameEnd, delegate(GameSession s)
            {
                GameCount--;
                Assert.AreEqual(lastGameSession, s);
            });

            GameMessages.SetCallback <GameRound>(GameMessages.Kind.RoundBegin, delegate(GameRound gr)
            {
                lastRound = gr;
                RoundCount++;
                RoundTotal++;
            });
            GameMessages.SetCallback <GameRound>(GameMessages.Kind.RoundEnd, delegate(GameRound gr)
            {
                Assert.AreEqual(gr, lastRound);
                RoundCount--;
            });

            GameMessages.SetCallback <GameTurn>(GameMessages.Kind.TurnBegin, delegate(GameTurn turn)
            {
                lastTurn = turn;
                TurnCount++;
                TurnTotal++;
            });
            GameMessages.SetCallback <GameTurn>(GameMessages.Kind.TurnEnd, delegate(GameTurn turn)
            {
                Assert.AreEqual(turn, lastTurn);
                TurnCount--;
            });
        }