Difference between revisions of "FillHandWithTiles"
RareMeme1337 (talk | contribs) (Created page with " == Creating FillHandWithTiles == private static void FillHandWithTiles(ref QueueOfTiles TileQueue, ref string PlayerTiles, int MaxHandSize) { while (PlayerTiles.Length <...") |
|||
Line 1: | Line 1: | ||
== Creating FillHandWithTiles == | == Creating FillHandWithTiles == | ||
− | + | <syntaxhighlight lang="csharp"> | |
private static void FillHandWithTiles(ref QueueOfTiles TileQueue, ref string PlayerTiles, int MaxHandSize) | private static void FillHandWithTiles(ref QueueOfTiles TileQueue, ref string PlayerTiles, int MaxHandSize) | ||
{ | { | ||
Line 10: | Line 10: | ||
} | } | ||
} | } | ||
− | + | </syntaxhighlight> | |
To break down the code, firstly a method is written called FillHandWithTiles, then it asks for conditions, PlayerTitles length is equal or less than the maximum hand size, if so, the remove a tile from the queue then add on that the player's hand tile that they removed from the queue. | To break down the code, firstly a method is written called FillHandWithTiles, then it asks for conditions, PlayerTitles length is equal or less than the maximum hand size, if so, the remove a tile from the queue then add on that the player's hand tile that they removed from the queue. |
Latest revision as of 12:08, 14 November 2017
Creating FillHandWithTiles
private static void FillHandWithTiles(ref QueueOfTiles TileQueue, ref string PlayerTiles, int MaxHandSize)
{
while (PlayerTiles.Length <= MaxHandSize)
{
PlayerTiles = PlayerTiles + TileQueue.Remove();
TileQueue.Add();
}
}
To break down the code, firstly a method is written called FillHandWithTiles, then it asks for conditions, PlayerTitles length is equal or less than the maximum hand size, if so, the remove a tile from the queue then add on that the player's hand tile that they removed from the queue.