|
|
@ -1,10 +1,10 @@
|
|
|
|
using QwirkleClassLibrary;
|
|
|
|
using QwirkleClassLibrary;
|
|
|
|
|
|
|
|
using System.Text;
|
|
|
|
using static System.Console;
|
|
|
|
using static System.Console;
|
|
|
|
|
|
|
|
|
|
|
|
static void testJeremy()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Game game = new Game();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void addPlayer(Game game)
|
|
|
|
|
|
|
|
{
|
|
|
|
string? enterline = "";
|
|
|
|
string? enterline = "";
|
|
|
|
|
|
|
|
|
|
|
|
do
|
|
|
|
do
|
|
|
@ -21,64 +21,93 @@ static void testJeremy()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} while (enterline != "quit");
|
|
|
|
} while (enterline != "quit");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
game.StartGame();
|
|
|
|
static void MainMenu(Game game)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
game.TilsBagPlayer();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String TagPlayerPlay;
|
|
|
|
|
|
|
|
TagPlayerPlay = game.NextPlayer();
|
|
|
|
|
|
|
|
|
|
|
|
if (game.GameRunning == true)
|
|
|
|
Write(" --------------------- GAME ! ------------------------ \n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Write(TagPlayerPlay + " you have main now ! \n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Write("\n --------------------- YOUR TILES ------------------------ \n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int pos = game.GetPlayingPlayerPosition();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < game.PlayerList[pos].Tiles.Count(); i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
stringBuilder.AppendLine(game.PlayerList[pos].Tiles[i].ToString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
game.TilsBagPlayer();
|
|
|
|
Write(stringBuilder);
|
|
|
|
|
|
|
|
|
|
|
|
String TagPlayerPlay;
|
|
|
|
Write("\n --------------------- CHOICES ------------------------ \n");
|
|
|
|
TagPlayerPlay = game.NextPlayer();
|
|
|
|
|
|
|
|
Write(TagPlayerPlay + " you have main now ! \n");
|
|
|
|
|
|
|
|
string s = game.ShowTileOfPlayer(game.GetPlayingPlayerPosition());
|
|
|
|
|
|
|
|
Write(s + "\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Write("[1] Place your tiles \n");
|
|
|
|
Write("[1] Place your tiles \n");
|
|
|
|
Write("[2] Swap your tiles \n");
|
|
|
|
Write("[2] Swap your tiles \n");
|
|
|
|
|
|
|
|
|
|
|
|
int enter = Convert.ToInt32(ReadLine());
|
|
|
|
int enter = Convert.ToInt32(ReadLine());
|
|
|
|
|
|
|
|
|
|
|
|
Tile tile = null;
|
|
|
|
switch (enter)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
|
|
CaseOneAddTile(game);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
switch (enter)
|
|
|
|
static void CaseOneAddTile(Game game)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Tile tile = null;
|
|
|
|
|
|
|
|
Write("Enter no tile : ");
|
|
|
|
|
|
|
|
int no = Convert.ToInt32(ReadLine());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (no >= 0 && no <= 5)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
tile = game.TileOfPlayerWithPos(no);
|
|
|
|
|
|
|
|
Write("Enter x : ");
|
|
|
|
|
|
|
|
int x = Convert.ToInt32(ReadLine());
|
|
|
|
|
|
|
|
Write("Enter y : ");
|
|
|
|
|
|
|
|
int y = Convert.ToInt32(ReadLine());
|
|
|
|
|
|
|
|
if (game.PlaceTileGame(tile, x, y) == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Write("ok ! your tile is placed \n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case 1:
|
|
|
|
Write("no no no \n");
|
|
|
|
// si good faire des boucles demain
|
|
|
|
|
|
|
|
Write("Enter no tile : ");
|
|
|
|
|
|
|
|
int no = Convert.ToInt32(ReadLine());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (no >= 0 && no <= 5)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
tile = game.TileOfPlayerWithPos(no);
|
|
|
|
|
|
|
|
Write("Enter x : ");
|
|
|
|
|
|
|
|
int x = Convert.ToInt32(ReadLine());
|
|
|
|
|
|
|
|
Write("Enter y : ");
|
|
|
|
|
|
|
|
int y = Convert.ToInt32(ReadLine());
|
|
|
|
|
|
|
|
if (game.PlaceTileGame(tile, x, y) == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Write("ok ! your tile is placed \n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Write("no no no \n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Write("No is out of range\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Write("No is out of range\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void testJeremy()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Game game = new Game();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addPlayer(game);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
game.StartGame();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (game.GameRunning == true)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MainMenu(game);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|