コード例 #1
0
ファイル: Match.cs プロジェクト: Aggrathon/rps_tournament
    /// <summary>
    /// This creates a match and starts it immediately
    /// </summary>
    /// <param name="player1"></param>
    /// <param name="player2"></param>
    /// <param name="callback">The function called when the match is over</param>
    public Match(IRPSPlayer player1, IRPSPlayer player2, MatchEnded callback)
    {
        this.player1 = player1;
        this.player2 = player2;

        playerOneHealth = player1.health;
        playerTwoHealth = player2.health;

        player1Choices = new LinkedList<RPS>();
        player2Choices = new LinkedList<RPS>();

        this.callback = callback;

        player1.startMatch(this);
        player2.startMatch(this);

        newRound();
    }