Exemplo n.º 1
0
        /// <summary>
        ///     Returns the Match object from Matches[] of the match of two given wrestlers of a Block
        /// </summary>
        /// <param name="wrestler1"></param>
        /// <param name="wrestler2"></param>
        public Match GetMatch(Wrestler wrestler1, Wrestler wrestler2)
        {
            int x = 0;

            while (x < Blocksize)
            {
                if (Wrestlers[x] == wrestler1)
                {
                    break;
                }
                x++;
            }

            int y = 0;

            while (y < Blocksize)
            {
                if (Wrestlers[y] == wrestler2)
                {
                    break;
                }
                y++;
            }

            return(Matches[x, y]);
        }
Exemplo n.º 2
0
 public void PredictWinner(Wrestler winner)
 {
     if (Match.MatchContenders[0].Wrestler == winner)
     {
         Match.MatchContenders[0].Result = Result.Win;
         Match.MatchContenders[1].Result = Result.Loss;
     }
     else
     {
         Match.MatchContenders[1].Result = Result.Win;
         Match.MatchContenders[0].Result = Result.Loss;
     }
 }
Exemplo n.º 3
0
        public Block(int blocksize)
        {
            Blocksize = blocksize;
            Wrestlers = new Wrestler[blocksize];
            Matches   = new Match[blocksize, blocksize];

            for (int x = 0; x < Blocksize; x++)
            {
                for (int y = 0; y < Blocksize; y++)
                {
                    Matches[x, y] = new Match();
                }
            }
        }
Exemplo n.º 4
0
 public Match(Wrestler wrestler1, Wrestler wrestler2)
 {
     MatchContenders = new MatchContender[] { new MatchContender(wrestler1), new MatchContender(wrestler2) };
     wrestler1.Matches.Add(this);
     wrestler2.Matches.Add(this);
 }
Exemplo n.º 5
0
 public MatchContender(Wrestler wrestler)
 {
     Wrestler = wrestler;
     Result   = null;
 }