By +Biscuits Brown,
We rely on ads to keep creating quality content for you to enjoy for free.
Please support our site by disabling your ad blocker.
Continue without supporting us
If the prompt is still appearing, please disable any tools or services you are using that block internet ads (e.g. DNS Servers, tracking protection or privacy extensions).
Question
Ch33f
The Form has 4 classes Card, Deck , Player and Game, game being the class that runs everything
The form has 3 TextBox named textName, textBooks and textProgress , ListBox named listHand, 2 buttons named buttonStart and buttonAsk
Card
Deck
Player
Game
The Program
The Game runs fine, but my question here is , I can't understand how the method GetWinnerName( ) in the class Game is working
In this loop
foreach (Values value in books.Keys)
{
string name = books[value].Name;
if (winners.ContainsKey(name)) //What is ContainsKey ?
winners[name]++; // What is happening here ?
else
winners.Add(name, 1); // What is happening here ?
}
Link to comment
https://www.neowin.net/forum/topic/1328866-having-problems-understanding-how-dictionary-is-working-in-this-program/Share on other sites
2 answers to this question
Recommended Posts