|
|
|
@ -13,7 +13,8 @@ namespace QwirkleClassLibrary
|
|
|
|
|
|
|
|
|
|
public class Game : IPlayer, IRules
|
|
|
|
|
{
|
|
|
|
|
private Dictionary<Player, int> scoreBoard = new();
|
|
|
|
|
public ReadOnlyDictionary<Player, int> ScoreBoard => scoreBoard.AsReadOnly();
|
|
|
|
|
private readonly Dictionary<Player, int> scoreBoard = new();
|
|
|
|
|
|
|
|
|
|
private TileBag bag;
|
|
|
|
|
public bool GameRunning { get; private set; }
|
|
|
|
@ -78,7 +79,6 @@ namespace QwirkleClassLibrary
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
players.Add(CreatePlayer(playerTag));
|
|
|
|
|
//scores.Add(new Score(players[players.Count-1]));
|
|
|
|
|
OnPlayerNotified(new AddPlayerNotifiedEventArgs("Player was correctly added"));
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -125,7 +125,7 @@ namespace QwirkleClassLibrary
|
|
|
|
|
{
|
|
|
|
|
if(GetPlayingPlayerPosition() == -1)
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentException();
|
|
|
|
|
throw new ArgumentException("No player play.");
|
|
|
|
|
}
|
|
|
|
|
return players[GetPlayingPlayerPosition()];
|
|
|
|
|
}
|
|
|
|
@ -166,7 +166,7 @@ namespace QwirkleClassLibrary
|
|
|
|
|
if (GameRunning)
|
|
|
|
|
{
|
|
|
|
|
players[0].IsPlaying = true;
|
|
|
|
|
//OnNextPlayer(new NextPlayerNotifiedEventArgs(players[0]));
|
|
|
|
|
OnNextPlayer(new NextPlayerNotifiedEventArgs(players[0]));
|
|
|
|
|
return players[0].NameTag;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|