|
|
|
@ -4,32 +4,35 @@
|
|
|
|
|
|
|
|
|
|
using Models;
|
|
|
|
|
using Models.Game;
|
|
|
|
|
using Models.Rules;
|
|
|
|
|
|
|
|
|
|
Position pos01 = new Position(0,0);
|
|
|
|
|
Position pos02 = new Position(1,0);
|
|
|
|
|
Position pos03 = new Position(2,0);
|
|
|
|
|
Position pos04 = new Position(3,0);
|
|
|
|
|
Position pos05 = new Position(4,0);
|
|
|
|
|
|
|
|
|
|
Position pos11 = new Position(0, 1);
|
|
|
|
|
Position pos12 = new Position(1, 1);
|
|
|
|
|
Position pos13 = new Position(2, 1);
|
|
|
|
|
Position pos14 = new Position(3, 1);
|
|
|
|
|
Position pos15 = new Position(4, 1);
|
|
|
|
|
|
|
|
|
|
Position pos21 = new Position(0, 2);
|
|
|
|
|
Position pos22 = new Position(1, 2);
|
|
|
|
|
Position pos23 = new Position(2, 2);
|
|
|
|
|
Position pos24 = new Position(3, 2);
|
|
|
|
|
Position pos25 = new Position(4, 2);
|
|
|
|
|
|
|
|
|
|
Position pos31 = new Position(0, 3);
|
|
|
|
|
Position pos32 = new Position(1, 3);
|
|
|
|
|
Position pos33 = new Position(2, 3);
|
|
|
|
|
Position pos34 = new Position(3,3);
|
|
|
|
|
Position pos35 = new Position(4, 3);
|
|
|
|
|
|
|
|
|
|
List<Position> list = new List<Position>();
|
|
|
|
|
|
|
|
|
|
Cell pos01 = new Cell(0,0);
|
|
|
|
|
Cell pos02 = new Cell(1,0);
|
|
|
|
|
Cell pos03 = new Cell(2,0);
|
|
|
|
|
Cell pos04 = new Cell(3,0);
|
|
|
|
|
Cell pos05 = new Cell(4,0);
|
|
|
|
|
|
|
|
|
|
Cell pos11 = new Cell(0, 1);
|
|
|
|
|
Cell pos12 = new Cell(1, 1);
|
|
|
|
|
Cell pos13 = new Cell(2, 1); //8
|
|
|
|
|
Cell pos14 = new Cell(3, 1);
|
|
|
|
|
Cell pos15 = new Cell(4, 1);
|
|
|
|
|
|
|
|
|
|
Cell pos21 = new Cell(0, 2); //8
|
|
|
|
|
Cell pos22 = new Cell(1, 2);
|
|
|
|
|
Cell pos23 = new Cell(2, 2);
|
|
|
|
|
Cell pos24 = new Cell(3, 2);
|
|
|
|
|
Cell pos25 = new Cell(4, 2);
|
|
|
|
|
|
|
|
|
|
Cell pos31 = new Cell(0, 3); //8
|
|
|
|
|
Cell pos32 = new Cell(1, 3);
|
|
|
|
|
Cell pos33 = new Cell(2, 3);
|
|
|
|
|
Cell pos34 = new Cell(3,3);
|
|
|
|
|
Cell pos35 = new Cell(4, 3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Cell> list = new List<Cell>();
|
|
|
|
|
list.Add(pos01);
|
|
|
|
|
list.Add(pos02);
|
|
|
|
|
list.Add(pos03);
|
|
|
|
@ -107,34 +110,82 @@ foreach (var item in list)
|
|
|
|
|
if (i % 4 == 0) Console.Write(" |\n");
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
Player p2 = new Player("Luka");
|
|
|
|
|
|
|
|
|
|
Game game = new Game(p2, new Map("background"));
|
|
|
|
|
|
|
|
|
|
OperationsGrid grille = new OperationsGrid();
|
|
|
|
|
|
|
|
|
|
//game.ResultOperation(Operation.ADDITION);
|
|
|
|
|
//game.ResultOperation(Operation.MULTIPLICATION);
|
|
|
|
|
//game.ResultOperation(Operation.LOWER);
|
|
|
|
|
//game.ResultOperation(Operation.MULTIPLICATION);
|
|
|
|
|
//game.ResultOperation(Operation.MULTIPLICATION);
|
|
|
|
|
//game.ResultOperation(Operation.HIGHER);
|
|
|
|
|
|
|
|
|
|
grille.ResultGrid(Operation.ADDITION);
|
|
|
|
|
grille.ResultGrid(Operation.MULTIPLICATION);
|
|
|
|
|
grille.ResultGrid(Operation.LOWER);
|
|
|
|
|
grille.ResultGrid(Operation.MULTIPLICATION);
|
|
|
|
|
grille.ResultGrid(Operation.MULTIPLICATION);
|
|
|
|
|
grille.ResultGrid(Operation.HIGHER);
|
|
|
|
|
game.UsedMap.Boards = list;
|
|
|
|
|
|
|
|
|
|
game.PlaceResult(pos02, 5);
|
|
|
|
|
game.PlaceResult(pos03, 5);
|
|
|
|
|
game.PlaceResult(pos32, 5);
|
|
|
|
|
|
|
|
|
|
game.PlaceResult(pos31, 8);
|
|
|
|
|
game.PlaceResult(pos21, 8);
|
|
|
|
|
game.PlaceResult(pos21, 8);
|
|
|
|
|
game.PlaceResult(pos13, 8);
|
|
|
|
|
|
|
|
|
|
int cpt = 0;
|
|
|
|
|
foreach (var item in grille.Tiles)
|
|
|
|
|
/*
|
|
|
|
|
foreach (var item in game.UsedMap.Boards)
|
|
|
|
|
{
|
|
|
|
|
Console.Write(" | ");
|
|
|
|
|
Console.Write(item);
|
|
|
|
|
Console.Write(item.Value);
|
|
|
|
|
cpt++;
|
|
|
|
|
if (cpt % 4 == 0) Console.Write(" |\n");
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i<game.UsedMap.Boards.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
Console.Write(" | ");
|
|
|
|
|
Console.Write(game.UsedMap.Boards[i].Value);
|
|
|
|
|
cpt++;
|
|
|
|
|
if (cpt % 5 == 0) Console.Write(" |\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(game.GameRules.IsZoneValidAndAddToZones(pos02, game.UsedMap));
|
|
|
|
|
|
|
|
|
|
//Console.WriteLine(game.GameRules.IsZoneValidAndAddToZones(pos13, game.UsedMap));
|
|
|
|
|
Console.WriteLine(game.GameRules.IsZoneValidAndAddToZones(pos31, game.UsedMap));
|
|
|
|
|
Console.WriteLine(game.GameRules.IsZoneValidAndAddToZones(pos13, game.UsedMap));
|
|
|
|
|
foreach(var oui in game.GameRules.EveryAdjacentCells(pos13, game.UsedMap.Boards))
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(oui.Value);
|
|
|
|
|
}
|
|
|
|
|
Console.WriteLine(game.GameRules.IsZoneValidAndAddToZones(pos32, game.UsedMap));
|
|
|
|
|
Console.WriteLine(game.GameRules.IsZoneValidAndAddToZones(pos33, game.UsedMap));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//affichage des zones
|
|
|
|
|
foreach (var item in game.UsedMap.Zones)
|
|
|
|
|
{
|
|
|
|
|
foreach (var cell in item)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(cell.Value);
|
|
|
|
|
}
|
|
|
|
|
Console.Write(" |\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Player p = new Player();
|
|
|
|
|
Player p2 = new Player("Luka");
|
|
|
|
|
Player p3 = new Player("Corento", "N/A");
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("Pseudo: " + p.Pseudo + "\nPhoto de Profil: " + p.ProfilePicture);
|
|
|
|
|
Console.WriteLine("========================================================");
|
|
|
|
|
Console.WriteLine("Pseudo: " + p2.Pseudo + "\nPhoto de Profil: " + p2.ProfilePicture);
|
|
|
|
|
Console.WriteLine("========================================================");
|
|
|
|
|
Console.WriteLine("Pseudo: " + p3.Pseudo + "\nPhoto de Profil: " + p3.ProfilePicture);
|
|
|
|
|
Console.WriteLine("Pseudo: " + p3.Pseudo + "\nPhoto de Profil: " + p3.ProfilePicture);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|