AddEndOfTurnTiles

From TRCCompSci - AQA Computer Science
Jump to: navigation, search

The "AddEndOfTurnTiles" subroutine checks the number of tiles left at the end of a round in the game, and

private static void AddEndOfTurnTiles(ref QueueOfTiles TileQueue, ref string PlayerTiles, string NewTileChoice, string Choice)
        {
            int NoOfEndOfTurnTiles = 0;

            if (NewTileChoice == "1")
            {
                NoOfEndOfTurnTiles = Choice.Length;
            }
            else if (NewTileChoice == "2")
            {
                NoOfEndOfTurnTiles = 3;
            }
            else
            {
                NoOfEndOfTurnTiles = Choice.Length + 3;
            }
            for (int Count = 0; Count < NoOfEndOfTurnTiles; Count++)
            {
                PlayerTiles = PlayerTiles + TileQueue.Remove();
                TileQueue.Add();
            }
        }