コード例 #1
0
ファイル: Bet.cs プロジェクト: ASE-Project-4/Test
        public bool ConcludeBet(User user, Outcome outcome)
        {
            if (Judge == user && Outcomes.Contains(outcome))
            {
                Result = outcome;
                Payout();
                return(true);
            }


            return(false);
        }
コード例 #2
0
ファイル: Bet.cs プロジェクト: ASE-Project-4/Test
        public bool joinBet(User user, Outcome outcome)
        {
            if (!Outcomes.Contains(outcome)) //todo needs to check the uses in Lobby
            {
                return(false);
            }

            user.Balance = -BuyIn;
            outcome.Participants.Add(user);


            return(true);
        }
コード例 #3
0
 /// <summary>
 /// Determines whether this instance contains the specified outcome.
 /// </summary>
 /// <param name="outcome">The outcome.</param>
 /// <returns>
 ///   <c>true</c> if this instance contains the specified outcome; otherwise, <c>false</c>.
 /// </returns>
 public bool Contains(int outcome)
 {
     return(Outcomes.Contains <int>(outcome));
 }