|
|
|
@ -11,25 +11,25 @@ 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 pos05 = new Cell(4,0); //4
|
|
|
|
|
|
|
|
|
|
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 pos15 = new Cell(4, 1); //4
|
|
|
|
|
|
|
|
|
|
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 pos25 = new Cell(4, 2); //4
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
Cell pos34 = new Cell(3, 3);
|
|
|
|
|
Cell pos35 = new Cell(4, 3); //4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Cell> list = new List<Cell>();
|
|
|
|
@ -57,71 +57,10 @@ list.Add(pos33);
|
|
|
|
|
list.Add(pos34);
|
|
|
|
|
list.Add(pos35);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*Pion pion1 = new Pion(une, 5);
|
|
|
|
|
Pion pion2 = new Pion(deux, 8);
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(pion1);
|
|
|
|
|
Console.WriteLine(pion2);
|
|
|
|
|
|
|
|
|
|
List<Pion> pions = new List<Pion>() { pion1, pion2 };
|
|
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Console.Write(" | ");
|
|
|
|
|
foreach (var pion in pions)
|
|
|
|
|
{
|
|
|
|
|
if (item.X == pion.Position.X && item.Y == pion.Position.Y)
|
|
|
|
|
{
|
|
|
|
|
Console.Write(pion);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
if (i%2 == 0) Console.Write(" |\n");
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*Pion pion1 = new Pion(pos35);
|
|
|
|
|
pion1.Select = true;
|
|
|
|
|
|
|
|
|
|
Pion pion2 = new Pion(pos11);
|
|
|
|
|
pion2.Select = true;
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(pion1);
|
|
|
|
|
|
|
|
|
|
List<Pion> list2 = new List<Pion>() { pion1,pion2 };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
|
|
foreach (var item in list)
|
|
|
|
|
{
|
|
|
|
|
Console.Write(" | ");
|
|
|
|
|
foreach (var pion in list2)
|
|
|
|
|
{
|
|
|
|
|
if (pion.Select == true && pion.Position.X == item.X && pion.Position.Y == item.Y) Console.Write("X");
|
|
|
|
|
}
|
|
|
|
|
i++;
|
|
|
|
|
if (i % 4 == 0) Console.Write(" |\n");
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
Player p2 = new Player("Luka");
|
|
|
|
|
|
|
|
|
|
Game game = new Game(p2, new Map("background"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//game.ResultOperation(Operation.ADDITION);
|
|
|
|
|
//game.ResultOperation(Operation.MULTIPLICATION);
|
|
|
|
|
//game.ResultOperation(Operation.LOWER);
|
|
|
|
|
//game.ResultOperation(Operation.MULTIPLICATION);
|
|
|
|
|
//game.ResultOperation(Operation.MULTIPLICATION);
|
|
|
|
|
//game.ResultOperation(Operation.HIGHER);
|
|
|
|
|
|
|
|
|
|
game.UsedMap.Boards = list;
|
|
|
|
|
|
|
|
|
|
game.PlaceResult(pos02, 5);
|
|
|
|
@ -133,6 +72,11 @@ game.PlaceResult(pos21, 8);
|
|
|
|
|
game.PlaceResult(pos21, 8);
|
|
|
|
|
game.PlaceResult(pos13, 8);
|
|
|
|
|
|
|
|
|
|
game.PlaceResult(pos05, 4);
|
|
|
|
|
game.PlaceResult(pos15, 4);
|
|
|
|
|
game.PlaceResult(pos25, 4);
|
|
|
|
|
game.PlaceResult(pos35, 4);
|
|
|
|
|
|
|
|
|
|
int cpt = 0;
|
|
|
|
|
/*
|
|
|
|
|
foreach (var item in game.UsedMap.Boards)
|
|
|
|
@ -154,16 +98,23 @@ for (int i = 0; i<game.UsedMap.Boards.Count; i++)
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(game.GameRules.IsZoneValidAndAddToZones(pos02, game.UsedMap));
|
|
|
|
|
|
|
|
|
|
//Console.WriteLine(game.GameRules.IsZoneValidAndAddToZones(pos13, 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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//foreach(var oui in game.GameRules.EveryAdjacentCells(pos13, game.UsedMap.Boards)) //du débug
|
|
|
|
|
//{
|
|
|
|
|
// Console.WriteLine(oui.Value);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(game.GameRules.IsZoneValidAndAddToZones(pos32, game.UsedMap));
|
|
|
|
|
Console.WriteLine(game.GameRules.IsZoneValidAndAddToZones(pos33, game.UsedMap));
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(game.GameRules.IsZoneValidAndAddToZones(pos05, game.UsedMap));
|
|
|
|
|
Console.WriteLine(game.GameRules.IsZoneValidAndAddToZones(pos15, game.UsedMap));
|
|
|
|
|
Console.WriteLine(game.GameRules.IsZoneValidAndAddToZones(pos25, game.UsedMap));
|
|
|
|
|
Console.WriteLine(game.GameRules.IsZoneValidAndAddToZones(pos35, game.UsedMap));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//affichage des zones
|
|
|
|
|
foreach (var item in game.UsedMap.Zones)
|
|
|
|
@ -175,17 +126,4 @@ foreach (var item in game.UsedMap.Zones)
|
|
|
|
|
Console.Write(" |\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Player p = new Player();
|
|
|
|
|
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(game.GameRules.FinalCalculusOfZones(game.UsedMap.Zones));
|