示例#1
0
            //this method is required for saving results in files
            public void SetResult(int[] scoreA, int[] scoreB)
            {
                scoreTeamA = scoreA;
                scoreTeamB = scoreB;
                int resultCheck = 0, scoreDiff = 0;

                for (int i = 0; i < 3; i++)
                {
                    if (scoreA[i] > scoreB[i])
                    {
                        resultCheck++;
                    }
                    else if (scoreTeamA[i] < scoreTeamB[i])
                    {
                        resultCheck--;
                    }
                    scoreDiff = scoreTeamA[i] - scoreTeamB[i];
                }
                if (Winner == TeamA)
                {
                    TeamA.SetMatchResult(true, false, false, (1 + Math.Abs(resultCheck)).ToString() + ", " + (scoreDiff).ToString());
                    TeamB.SetMatchResult(false, false, false, (2 - Math.Abs(resultCheck)).ToString() + ", " + (-scoreDiff).ToString());
                }
                if (Winner == TeamB)
                {
                    TeamA.SetMatchResult(false, false, false, (2 - Math.Abs(resultCheck)).ToString() + ", " + (-scoreDiff).ToString());
                    TeamB.SetMatchResult(true, false, false, (1 + Math.Abs(resultCheck)).ToString() + ", " + (scoreDiff).ToString());
                }
            }
示例#2
0
        public Result ReschuduleMachDate(DateTime newMatchDate)
        {
            Guard.Against.Null(newMatchDate, nameof(newMatchDate));
            Guard.Against.Default(newMatchDate, nameof(newMatchDate));
            Guard.Against.DateBeforeNow(newMatchDate, nameof(newMatchDate));

            if (MatchDate == newMatchDate)
            {
                return(Result.Success());
            }

            var canReschuduleResult = TeamA.CanReschuduleMatchDate(this, newMatchDate);

            if (canReschuduleResult.IsFailure)
            {
                Result.Failure(canReschuduleResult.Error);
            }

            canReschuduleResult = TeamB.CanReschuduleMatchDate(this, newMatchDate);
            if (canReschuduleResult.IsFailure)
            {
                Result.Failure(canReschuduleResult.Error);
            }

            MatchDate = newMatchDate;

            return(Result.Success());
        }
示例#3
0
    IEnumerator DoRound()
    {
        yield return(new WaitForSeconds(battlePrepTime));

        //checking for no dancers on either team
        if (TeamA.activeDancers.Count > 0 && TeamB.activeDancers.Count > 0)
        {
            Debug.LogWarning("DoRound called, it needs to select a dancer from each team to dance off and put in the FightEventData below");


            //selecting a random character from each team to battle from active dance list
            RandTeamA = TeamA.activeDancers[Random.Range(0, TeamA.activeDancers.Count)];
            RandTeamB = TeamB.activeDancers[Random.Range(0, TeamB.activeDancers.Count)];

            GameEvents.RequestFight(new FightEventData(RandTeamA, RandTeamB));
        }
        else
        {
            //team A won the round do win effect
            if (TeamA.activeDancers.Count > TeamB.activeDancers.Count)
            {
                GameEvents.BattleFinished(TeamA);
                TeamA.EnableWinEffects();
            }
            //team b won the round do win effect
            else
            {
                GameEvents.BattleFinished(TeamB);
                TeamB.EnableWinEffects();
            }

            //log it battlelog also
            Debug.Log("DoRound called, but we have a winner so Game Over");
        }
    }
示例#4
0
            //This is based on the assumption that stat is going to be in seconds (possibly with miliseconds)
            public override void SetResult(string stat, TTeam.ITeam winner)
            {
                float tmp = matchLength;

                //a safety check just in case stat is not a number
                try
                {
                    matchLength = float.Parse(stat);
                    if (matchLength < 0)
                    {
                        matchLength = 0;
                        throw new NegativeMatchLengthException(CreateCopy());
                    }
                }
                //float.parse throws FormatException if stat can't be converted
                catch (FormatException)
                {
                    throw new NotNumberMatchLengthException(CreateCopy());
                }
                winner.SetMatchResult(true, tmp != 0, tmp != 0 && this.Winner == winner, stat + " - " + tmp.ToString());
                if (winner == TeamA)
                {
                    TeamB.SetMatchResult(false, tmp != 0, tmp != 0 && this.Winner == TeamB, stat + " - " + tmp.ToString());
                }
                else
                {
                    TeamA.SetMatchResult(false, tmp != 0, tmp != 0 && this.Winner == TeamA, stat + " - " + tmp.ToString());
                }
                base.SetResult(stat, winner);
            }
示例#5
0
        /// <summary>
        /// Method to enter the scores of the Game (once the game is finished).
        /// It automatically calculates the Winner (or Draw) and adds points to the winning team.
        /// If the scores were already entered, it updates the scores, the winner and recalculates the points given to each team (cancels the previouses and adds the new ones)
        /// </summary>
        /// <remarks>
        /// 3 points for a victory
        /// 1 point for a draw
        /// 0 point for a defeat
        /// + score*0.001 for each team
        /// </remarks>
        /// <param name="scoreA"></param>
        /// <param name="scoreB"></param>
        public void EnterScore(int scoreA, int scoreB)
        {
            //If the scores have already been entered, we delete them to enter new scores
            if (Winner != null)
            {
                CancelPreviousEnterScore();
            }

            this.ScoreA      = scoreA;
            this.ScoreB      = scoreB;
            TeamA.ScoresSum += ScoreA;
            TeamB.ScoresSum += ScoreB;

            if (ScoreA - ScoreB > 0) //TeamA wins
            {
                Winner = Convert.ToString(TeamA.Id);
                TeamA.PointsOfVictoriesAndDraws += 3;
            }
            else if (ScoreA - ScoreB == 0) //Draw
            {
                Winner = "Match nul";
                TeamA.PointsOfVictoriesAndDraws += 1;
                TeamB.PointsOfVictoriesAndDraws += 1;
            }
            else //TeamB wins
            {
                Winner = Convert.ToString(TeamB.Id);
                TeamB.PointsOfVictoriesAndDraws += 3;
            }
            TeamA.ComputeTotalScore();
            TeamB.ComputeTotalScore();
        }
示例#6
0
    IEnumerator DoRound()
    {
        yield return(new WaitForSeconds(battlePrepTime));

        if (TeamA.activeDancers.Count > 0 && TeamB.activeDancers.Count > 0)
        {
            //Debug.LogWarning("DoRound called, it needs to select a dancer from each team to dance off and put in the FightEventData below");
            Character a = TeamA.activeDancers[Random.Range(0, TeamA.activeDancers.Count)];
            Character b = TeamB.activeDancers[Random.Range(0, TeamB.activeDancers.Count)];
            GameEvents.RequestFight(new FightEventData(a, b));
        }
        else
        {
            if (TeamA.activeDancers.Count != 0)
            {
                GameEvents.BattleFinished(TeamA);
                TeamA.EnableWinEffects();
            }
            else
            {
                GameEvents.BattleFinished(TeamB);
                TeamB.EnableWinEffects();
            }


            //log it battlelog also
            //Debug.Log("DoRound called, but we have a winner so Game Over");
        }
    }
示例#7
0
    void FightOver(FightResultData data)
    {
        Debug.LogWarning("FightOver called, may need to check for winners and/or notify teams of zero mojo dancers");

        //who won over all
        if (data.outcome >= 1)
        {
            TeamB.RemoveFromActive(RandTeamB);
        }
        else
        {
            TeamA.RemoveFromActive(RandTeamA);
        }

        Debug.Log(data.outcome);

        // play the win/lose effects
        data.winner.myTeam.EnableWinEffects();

        // remove the defeated character
        data.defeated.myTeam.RemoveFromActive(data.defeated);

        //defaulting to starting a new round to ease development
        //calling the coroutine so we can put waits in for anims to play
        StartCoroutine(HandleFightOver());
    }
示例#8
0
        private void HitStepByStep()
        {
            if (IsTeamATurn)
            {
                var player = TeamA.GetRandomAliveUnit();
                if (!player.IsStunned)
                {
                    DisplayFightDialog();
                    if (IsExitDone)
                    {
                        return;
                    }
                    Console.WriteLine($"Your opponent is {ChosenOpponent}");
                }
                player.Attack(TeamB.AliveUnits[ChosenOpponent]);
            }
            else
            {
                TeamB.GetRandomAliveUnit().Attack(TeamA.GetRandomAliveUnit());
            }

            IsTeamATurn = !IsTeamATurn;
            Console.WriteLine();
            IsAnyChange = true;
        }
示例#9
0
    IEnumerator HandleFightOver()
    {
        yield return(new WaitForSeconds(fightWinTime));

        TeamA.DisableWinEffects();
        TeamB.DisableWinEffects();
        GameEvents.RequestFighters();
    }
示例#10
0
    IEnumerator HandleFightOver()
    {
        yield return(new WaitForSeconds(fightWinTime));

        TeamA.DisableWinEffects();
        TeamB.DisableWinEffects();
        Debug.LogWarning("HandleFightOver called, may need to prepare or clean dancers or teams and checks before doing GameEvents.RequestFighters()");
        GameEvents.RequestFighters();
    }
示例#11
0
 public void SetResult(float matchLength)
 {
     this.matchLength = matchLength;
     if (Winner != null)
     {
         TeamA.SetMatchResult(TeamA == Winner, false, false, matchLength + " - " + 0.ToString());
         TeamB.SetMatchResult(TeamB == Winner, false, false, matchLength + " - " + 0.ToString());
     }
 }
示例#12
0
        //NotifyCollectionChangedEventHandler UpdateStatsHandler;


        private void CrudeTeamSettings() //TODO: change to sth meaningfull
        {
            TeamA = Players.Take(4).ToList();
            TeamB = Players.TakeLast(4).ToList();

            TeamAOnCourt = new ObservableCollection <Player>(TeamA.Take(3).ToList());
            TeamBOnCourt = new ObservableCollection <Player>(TeamB.Take(3).ToList());
            TeamABench   = new ObservableCollection <Player>(TeamA.TakeLast(1).ToList());
            TeamBBench   = new ObservableCollection <Player>(TeamB.TakeLast(1).ToList());
        }
示例#13
0
        static void Main(string[] args)
        {
            Team teamA = new TeamA("A");

            teamA.Players = new List <Player>()
            {
                new Player()
                {
                    Team = teamA,
                    Name = "playerA"
                }
            };
            Team teamB = new TeamB("B");

            teamA.Players = new List <Player>()
            {
                new Player()
                {
                    Team = teamB,
                    Name = "playerB"
                }
            };

            Match m = new Match(WinningSet.BEST_OF_FIVE)
            {
                MatchName = "Tournament ABC",
                TeamA     = teamA,
                TeamB     = teamB
            };

            System.Console.WriteLine("match has started, enter team name (A or B):");
            while (true)
            {
                string team = System.Console.ReadLine();
                if (team != "a" && team != "b" && team != "A" && team != "B")
                {
                    System.Console.WriteLine("Equipe invalide, doit-être A ou B");
                }
                else
                {
                    m.TeamScores(team.ToUpper());
                    System.Console.Write("score in game is " + m.CurrentSet.CurrentGame.ScoreGame.GameScore);
                    if (m.CurrentSet.TieBreak != null)
                    {
                        System.Console.WriteLine("[" + m.CurrentSet.TieBreak.ScoreTieBreak.TieScore + "]");
                    }
                    else
                    {
                        System.Console.WriteLine("");
                    }
                    System.Console.WriteLine("score games in set is " + m.CurrentSet.ScoreSet.SetScore);
                    System.Console.WriteLine("Sets are " + m.ScoreMatch.MatchScore);
                }
            }
        }
示例#14
0
 private void DisplayWinner()
 {
     if (TeamA.IsAllUnitsAlive)
     {
         TeamA.PrintAliveUnits();
     }
     else if (TeamB.IsAllUnitsAlive)
     {
         TeamB.PrintAliveUnits();
     }
 }
示例#15
0
文件: Match.cs 项目: rmstreet/RM.TM
 private void ValidateTeamB()
 {
     if (TeamB.IsValid())
     {
         return;
     }
     foreach (var error in TeamB.ValidationResult.Errors)
     {
         ValidationResult.Errors.Add(error);
     }
 }
示例#16
0
 public void AddToTeam(int teamNo, CharacterBehaviour character)
 {
     if (teamNo == 0)
     {
         TeamA.Add(character);
     }
     else if (teamNo == 1)
     {
         TeamB.Add(character);
     }
 }
示例#17
0
 public void SetResult(int wPlayersLeft)
 {
     winnerPlayersLeft = wPlayersLeft;
     if (Winner == TeamA)
     {
         TeamA.SetMatchResult(TeamA == Winner, false, false, winnerPlayersLeft + ", " + 6);
         TeamB.SetMatchResult(TeamB == Winner, false, false, 0 + ", " + (6 - winnerPlayersLeft));
     }
     if (Winner == TeamB)
     {
         TeamB.SetMatchResult(TeamB == Winner, false, false, winnerPlayersLeft + ", " + 6);
         TeamA.SetMatchResult(TeamA == Winner, false, false, 0 + ", " + (6 - winnerPlayersLeft));
     }
 }
示例#18
0
        private void InstChars(string[] names)
        {
            int size = names.Length;

            for (int i = 1; i <= size; i++)
            {
                if (i <= (size / 2))
                {
                    TeamA.Add(InstChar(names[i - 1], i, 0));
                }
                else
                {
                    TeamB.Add(InstChar(names[i - 1], i, 1));
                }
            }
        }
示例#19
0
        private void HitStepByStep()
        {
            if (IsTeamBTurn)
            {
                TeamB.GetRandomAliveUnit().Attack(TeamA);
            }
            else
            {
                TeamA.GetRandomAliveUnit().Attack(TeamB);
            }

            IsTeamBTurn = !IsTeamBTurn;
            TeamA.ActEachTurn();
            TeamB.ActEachTurn();
            Console.WriteLine();
        }
示例#20
0
            public override void SetResult(string stat, TTeam.ITeam winner)
            {
                int playersEliminatedChange = 0, playersLeftChange = 0;

                if (this.Winner == winner)
                {
                    playersLeftChange = winnerPlayersLeft;
                }
                else
                {
                    if (this.Winner != null)
                    {
                        playersEliminatedChange = 6 - winnerPlayersLeft;
                    }
                }
                //if stat is not a number parse will throw format exception
                try
                {
                    winnerPlayersLeft = int.Parse(stat);
                    if (winnerPlayersLeft <= 0)
                    {
                        winnerPlayersLeft = 0;
                        throw new NegativePlayersNumberException(CreateCopy());
                    }
                    if (winnerPlayersLeft > 6)
                    {
                        winnerPlayersLeft = 0;
                        throw new TooHighPlayersLeftException(CreateCopy());
                    }
                }
                catch (FormatException)
                {
                    throw new NotIntPlayersException(CreateCopy());
                }
                winner.SetMatchResult(true, playersEliminatedChange != 0 || playersLeftChange != 0, (playersEliminatedChange != 0 || playersLeftChange != 0) && this.Winner == winner, (winnerPlayersLeft - playersLeftChange).ToString() + ", " + playersEliminatedChange.ToString());
                if (winner == TeamA)
                {
                    TeamB.SetMatchResult(false, playersEliminatedChange != 0 || playersLeftChange != 0, (playersEliminatedChange != 0 || playersLeftChange != 0) && this.Winner == TeamB, (-playersLeftChange).ToString() + ", " + (6 - winnerPlayersLeft - playersEliminatedChange).ToString());
                }
                else
                {
                    TeamA.SetMatchResult(false, playersEliminatedChange != 0 || playersLeftChange != 0, (playersEliminatedChange != 0 || playersLeftChange != 0) && this.Winner == TeamA, (-playersLeftChange).ToString() + ", " + (6 - winnerPlayersLeft - playersEliminatedChange).ToString());
                }
                base.SetResult(stat, winner);
            }
示例#21
0
    IEnumerator DoRound()
    {
        yield return(new WaitForSeconds(battlePrepTime));

        //checking for no dancers on either team
        if (TeamA.activeDancers.Count > 0 && TeamB.activeDancers.Count > 0)
        {
            Debug.LogWarning("DoRound called, it needs to select a dancer from each team to dance off and put in the FightEventData below");

            // pick a dancer from Team A and a dancer from Team B
            teamA = TeamA.activeDancers[Random.Range(0, TeamA.activeDancers.Count)];
            teamB = TeamB.activeDancers[Random.Range(0, TeamB.activeDancers.Count)];
            GameEvents.RequestFight(new FightEventData(teamA, teamB));
        }
        else
        {
            // Work out who the winning team is

            // If team a's dancers are less than or equal to 0...
            if (TeamA.activeDancers.Count <= 0)
            {
                // ...Finish the game and make team b win.
                GameEvents.BattleFinished(TeamA);
                TeamB.EnableWinEffects();
            }
            else if (TeamB.activeDancers.Count >= 0) // else if team b's dancers are less than or equal to 0...
            {
                // ...Finish the game and make team a win.
                GameEvents.BattleFinished(TeamB);
                TeamA.EnableWinEffects();
            }
            //GameEvents.BattleFinished(Winner);
            //Winner.EnableWinEffects();

            //log it battlelog also
            Debug.Log("DoRound called, but we have a winner so Game Over");

            SceneManager.LoadScene(0);
        }
    }
示例#22
0
 public void ResetGame()
 {
     HasGameStarted = false;
     TeamA.SelectNextCoder();
     TeamB.SelectNextCoder();
 }
示例#23
0
        private void ChoosePlayer(int Id)
        {
            var _player = Players.First(p => p.Id == Id);

            if (!_playFactory.HasPlay)
            {
                SetZeroVisibility();
                SetDefaultButtonsVisibleOnly();
                //_play = NewPlayNow(Players.First(p => p.Id == Id), PossesionTeamB);
                _playFactory.NewPlay(_player, PossesionTeamB);
                InfoText = "Wybierz akcję:";
            }
            else
            {
                //_play.Player = Players.First(p => p.Id == Id);
                _playFactory.ConsecutivePlay(_player, TeamB.Contains(_player));
                foreach (var play in _playFactory.GetPlays())
                {
                    Plays.Add(play);

                    if (play.PlayType == PlayType.CheckIn)
                    {
                        if (TeamABench.Contains(play.Player))
                        {
                            TeamABench.Remove(play.Player);
                            TeamAOnCourt.Add(play.Player);
                        }
                        if (TeamBBench.Contains(play.Player))
                        {
                            TeamBBench.Remove(play.Player);
                            TeamBOnCourt.Add(play.Player);
                        }
                    }
                    if (play.PlayType == PlayType.CheckOut)
                    {
                        if (TeamAOnCourt.Contains(play.Player))
                        {
                            TeamAOnCourt.Remove(play.Player);
                            TeamABench.Add(play.Player);
                        }
                        if (TeamBOnCourt.Contains(play.Player))
                        {
                            TeamBOnCourt.Remove(play.Player);
                            TeamBBench.Add(play.Player);
                        }
                    }
                }
                ;

                if (Plays.Last().PlayType == PlayType.Rebound)
                {
                    PossesionTeamB = Plays.Last().TeamB;
                }
                _playFactory.Clear();

                //switch possesion dla zbiorki nieofensywnej
                InfoText = "Wybierz zawodnika";
                SetDefaultButtonsVisibleOnly();
                SetPlayersVisibility();
            }
        }
示例#24
0
            //the expected format is "team1.Name: scoreInSet1, scoreInSet2, scoreInSet3(0 if not played). team2.Name: scoreInSet1, scoreInSet2, scoreInSet3(0 if not played)"
            public override void SetResult(string stat, TTeam.ITeam winner)
            {
                int resultCheck = 0, scoreDiff = 0;
                int earlierScoreDiff = 0, earlierPoints = 0;

                if (WasPlayed())
                {
                    for (int i = 0; i < 3; i++)
                    {
                        earlierScoreDiff += scoreTeamA[i] - scoreTeamB[i];
                        if (scoreTeamA[i] > scoreTeamB[i])
                        {
                            earlierPoints++;
                        }
                        if (scoreTeamA[i] < scoreTeamB[i])
                        {
                            earlierPoints--;
                        }
                    }
                    if (earlierPoints > 0)
                    {
                        earlierPoints++;
                    }
                    else
                    {
                        earlierPoints += 2;
                    }
                }
                //split the strings into strings containing name of the teams and their scores
                string[] tmp = stat.Split(new string[] { ". ", ", ", ": " }, StringSplitOptions.RemoveEmptyEntries);
                //string should split into 8 smaller string (2 for names of teams, 6 in total for scores in sets)
                if (tmp.Length != 8)
                {
                    throw new WrongStatFormatException(CreateCopy());
                }
                for (int i = 0; i < 3; i++)
                {
                    int scoreRequired;
                    if (i != 2)
                    {
                        scoreRequired = 21;
                    }
                    else
                    {
                        scoreRequired = 15;
                    }
                    try
                    {
                        if (tmp[0].Equals(TeamA.Name) && tmp[4].Equals(TeamB.Name))
                        {
                            scoreTeamA[i] = int.Parse(tmp[i + 1]);
                            scoreTeamB[i] = int.Parse(tmp[i + 5]);
                        }
                        else
                        {
                            if (tmp[0].Equals(TeamB.Name) && tmp[4].Equals(TeamA.Name))
                            {
                                scoreTeamB[i] = int.Parse(tmp[i + 1]);
                                scoreTeamA[i] = int.Parse(tmp[i + 5]);
                            }
                            else
                            {
                                if (TeamA.Name.Equals(tmp[0]) || TeamB.Name.Equals(tmp[0]))
                                {
                                    Console.WriteLine(TeamA.Name + " " + TeamB.Name);
                                    throw new WrongNameInStatException(CreateCopy(), tmp[4]);
                                }
                                else
                                {
                                    ToString();
                                    throw new WrongNameInStatException(CreateCopy(), tmp[0]);
                                }
                            }
                        }

                        //score should be equal or higher than 0, but equal or lower than 21 in first two sets
                        //and equal or lower than 15 in the third set
                        if (scoreTeamA[i] < 0 || scoreTeamB[i] < 0)
                        {
                            for (int j = 0; j < 3; j++)
                            {
                                scoreTeamA[j] = 0;
                                scoreTeamB[j] = 0;
                            }
                            throw new NegativeScoreException(CreateCopy());
                        }
                        if (scoreTeamA[i] > scoreRequired || scoreTeamB[i] > scoreRequired)
                        {
                            for (int j = 0; j < 3; j++)
                            {
                                scoreTeamA[j] = 0;
                                scoreTeamB[j] = 0;
                            }
                            throw new TooHighScoreException(CreateCopy());
                        }
                    }
                    catch (FormatException)
                    {
                        throw new NonIntScoreException(CreateCopy());
                    }
                    //Checking whether the score makes sense and reflects the winner
                    //if a team has won in 2 sets third one should end 0:0
                    if (Math.Abs(resultCheck) == 2)
                    {
                        if (scoreTeamA[i] != 0 || scoreTeamB[i] != 0)
                        {
                            if (resultCheck > 0)
                            {
                                for (int j = 0; j < 3; j++)
                                {
                                    scoreTeamA[j] = 0;
                                    scoreTeamB[j] = 0;
                                }
                                throw new ThirdSetException(CreateCopy(), TeamA);
                            }
                            else
                            {
                                for (int j = 0; j < 3; j++)
                                {
                                    scoreTeamA[j] = 0;
                                    scoreTeamB[j] = 0;
                                }
                                throw new ThirdSetException(CreateCopy(), TeamB);
                            }
                        }
                    }
                    //Checking if exactly one team has reached the required points
                    else
                    {
                        if (scoreTeamA[i] == scoreTeamB[i] || (scoreTeamA[i] < scoreRequired && scoreTeamB[i] < scoreRequired))
                        {
                            throw new NoSetWinnerException(CreateCopy(), i + 1);
                        }
                        if (scoreTeamA[i] == scoreRequired)
                        {
                            resultCheck++;
                        }
                        if (scoreTeamB[i] == scoreRequired)
                        {
                            resultCheck--;
                        }
                        scoreDiff += scoreTeamA[i] - scoreTeamB[i];
                    }
                }
                //checking if a team which should have won by what the stat indicates was set as a winner
                if ((resultCheck > 0 && TeamA != winner) || (resultCheck < 0 && TeamB != winner))
                {
                    for (int j = 0; j < 3; j++)
                    {
                        scoreTeamA[j] = 0;
                        scoreTeamB[j] = 0;
                    }
                    throw new WrongWinnerException(CreateCopy(), winner);
                }
                int temp = 0;

                if (WasPlayed())
                {
                    temp = 3 - earlierPoints;
                }
                if (winner == TeamA)
                {
                    TeamA.SetMatchResult(true, earlierScoreDiff != 0, earlierScoreDiff != 0 && this.Winner == TeamA, (1 + Math.Abs(resultCheck) - earlierPoints).ToString() + ", " + (scoreDiff - earlierScoreDiff).ToString());
                    TeamB.SetMatchResult(false, earlierScoreDiff != 0, earlierScoreDiff != 0 && this.Winner == TeamB, (2 - Math.Abs(resultCheck) - temp).ToString() + ", " + (earlierScoreDiff - scoreDiff).ToString());
                }
                else
                {
                    TeamA.SetMatchResult(false, earlierScoreDiff != 0, earlierScoreDiff != 0 && this.Winner == TeamA, (2 - Math.Abs(resultCheck) - temp).ToString() + ", " + (earlierScoreDiff - scoreDiff).ToString());
                    TeamB.SetMatchResult(true, earlierScoreDiff != 0, earlierScoreDiff != 0 && this.Winner == TeamB, (1 + Math.Abs(resultCheck) - earlierPoints).ToString() + ", " + (scoreDiff - earlierScoreDiff).ToString());
                }
                base.SetResult(stat, winner);
            }
示例#25
0
 internal void DisplayScore()
 {
     TeamA.PrintAliveUnits();
     Console.WriteLine();
     TeamB.PrintAliveUnits();
 }