|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Threading.Tasks.Dataflow;
|
|
|
|
|
using Models.Events;
|
|
|
|
|
using Models.Rules;
|
|
|
|
|
|
|
|
|
@ -75,14 +76,40 @@ namespace Models.Game
|
|
|
|
|
playerChoice.Value = result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
public void AddToRopePath(Cell cell)
|
|
|
|
|
|
|
|
|
|
public void AddToRopePath(Cell playerChoice, List<List<Cell>> ropePaths,Cell adjacente)
|
|
|
|
|
{
|
|
|
|
|
if (GameRules.IsRopePath(cell, ropePaths)) return;
|
|
|
|
|
|
|
|
|
|
List<List<Cell>> possiblePaths;
|
|
|
|
|
|
|
|
|
|
// {adjacentes} ne doit pas etre egale a {playerChoice}
|
|
|
|
|
if (adjacente.Value == playerChoice.Value) return;
|
|
|
|
|
|
|
|
|
|
// {adjacentes} doit etre croissant ou decroissant
|
|
|
|
|
if ((adjacente.Value - playerChoice.Value > 1) || (adjacente.Value - playerChoice.Value < -1)) return;
|
|
|
|
|
|
|
|
|
|
// Un nombre ne peut appartenir qu'a un seul chemin de corde
|
|
|
|
|
foreach (List<Cell> paths in ropePaths)
|
|
|
|
|
{
|
|
|
|
|
foreach (var cells in paths)
|
|
|
|
|
{
|
|
|
|
|
if (adjacente.X == cells.X && adjacente.Y == adjacente.Y)
|
|
|
|
|
{
|
|
|
|
|
possiblePaths.Add(paths);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Si {ropePaths} est vide, il faut alors creer un chemin de corde entre {playerChoice}
|
|
|
|
|
if (ropePaths.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void InitializeGame()
|
|
|
|
|
{
|
|
|
|
@ -107,5 +134,6 @@ namespace Models.Game
|
|
|
|
|
await Task.Delay(1000); // 1 seconde
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|