Пример #1
0
 private void leaveMatch_Click(object sender, RoutedEventArgs e)
 {
     leaveMatch.IsEnabled = false;
     joinMatch.IsEnabled  = true;
     selectedMatch        = (Match)matchViewList.SelectedItem;
     MatchHubProxy.Invoke("LeaveMatch", selectedMatch.Name);
     cStatus.Content = "Not Connected";
 }
Пример #2
0
        /// <summary>
        /// Algorithm to calculate odds based on round win. invokes BroadcastRoed(Round round) and BroadcastOdds(List<Odds> odds, Round round) on the matchHub.
        /// </summary>
        /// <param name="round"></param>
        public void CalculateOdds(Round round)
        {
            MatchHubProxy.Invoke("BroadcastRound", round);

            if (round.Number == 1)
            {
                odds.Add(CurrentTeam0Odds = 1.5M);
                odds.Add(CurrentTeam1Odds = 1.5M);
            }

            if (round.Winner == round.Match.Teams[0])
            {
                odds[0] = (CurrentTeam0Odds = CurrentTeam0Odds - ((CurrentTeam0Odds - 1M) * 0.15M));
                odds[1] = (CurrentTeam1Odds = CurrentTeam1Odds + ((CurrentTeam1Odds - 1M) * 0.15M));
            }
            else
            {
                odds[1] = (CurrentTeam1Odds = CurrentTeam1Odds - ((CurrentTeam1Odds - 1M) * 0.15M));
                odds[0] = (CurrentTeam0Odds = CurrentTeam0Odds + ((CurrentTeam0Odds - 1M) * 0.15M));
            }
            MatchHubProxy.Invoke("BroadcastOdds", odds, round);
        }