|
|
@ -1,24 +1,26 @@
|
|
|
|
using QwirkleClassLibrary;
|
|
|
|
using QwirkleClassLibrary;
|
|
|
|
|
|
|
|
using QwirkleConsoleApp;
|
|
|
|
using System.Net.Quic;
|
|
|
|
using System.Net.Quic;
|
|
|
|
using System.Text;
|
|
|
|
using System.Text;
|
|
|
|
using System.Transactions;
|
|
|
|
using System.Transactions;
|
|
|
|
using static System.Console;
|
|
|
|
using static System.Console;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void AddPlayers(Game game)
|
|
|
|
static void AddPlayers(Game game)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
NotificationClass nc = new NotificationClass();
|
|
|
|
|
|
|
|
|
|
|
|
while (game.PlayerList.Count < 4)
|
|
|
|
while (game.PlayerList.Count < 4)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Write("Enter player tag : ");
|
|
|
|
Write("Enter player tag : ");
|
|
|
|
string? playerTag = ReadLine();
|
|
|
|
string? playerTag = ReadLine();
|
|
|
|
|
|
|
|
|
|
|
|
if (game.AddPlayerInGame(playerTag) == false)
|
|
|
|
game.AddPlayerInGame(playerTag);
|
|
|
|
{
|
|
|
|
|
|
|
|
WriteLine("ERROR : Player already exist or game is running !");
|
|
|
|
game.PlayerAddNotified -= nc.NotificationMessagePlayer;
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
game.PlayerAddNotified += nc.NotificationMessagePlayer;
|
|
|
|
{
|
|
|
|
|
|
|
|
WriteLine("Player " + playerTag + " added !");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Write("Do you want to add another player ? (y/n) : ");
|
|
|
|
Write("Do you want to add another player ? (y/n) : ");
|
|
|
|
string? answer = ReadLine();
|
|
|
|
string? answer = ReadLine();
|
|
|
@ -45,7 +47,7 @@ static void ShowTiles(Game game)
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < currentPlayer.Tiles.Count(); i++)
|
|
|
|
for (int i = 0; i < currentPlayer.Tiles.Count(); i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
stringBuilder.Append("[" + (i+1) + "] ");
|
|
|
|
stringBuilder.Append("[" + (i + 1) + "] ");
|
|
|
|
stringBuilder.AppendLine(currentPlayer.Tiles[i].ToString());
|
|
|
|
stringBuilder.AppendLine(currentPlayer.Tiles[i].ToString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|