From 33992b636df8ffc845621d5a1996e3003f1950f6 Mon Sep 17 00:00:00 2001 From: "jules.lascret" Date: Fri, 10 May 2024 17:08:36 +0200 Subject: [PATCH] that works for now but I don't deserve to title of genius yet --- Qwirkle/QwirkleClassLibrary/Game.cs | 95 ----------------------------- 1 file changed, 95 deletions(-) diff --git a/Qwirkle/QwirkleClassLibrary/Game.cs b/Qwirkle/QwirkleClassLibrary/Game.cs index 2049b4e..cf9f723 100644 --- a/Qwirkle/QwirkleClassLibrary/Game.cs +++ b/Qwirkle/QwirkleClassLibrary/Game.cs @@ -207,101 +207,6 @@ namespace QwirkleClassLibrary return true; } - // public bool IsMoveCorrect(Tile t, int x, int y, Board b) - // { - // if (b.HasOccupiedCase() == false) - // { - // return true; - // } - // - // var surroundingCells = new List(); - // - // surroundingCells.Add(b.GetCell(x + 1, y)); - // surroundingCells.Add(b.GetCell(x - 1, y)); - // surroundingCells.Add(b.GetCell(x, y + 1)); - // surroundingCells.Add(b.GetCell(x, y - 1)); - // - // foreach (var cell in surroundingCells.ToList()) - // { - // if (cell?.GetTile == null) - // { - // surroundingCells.Remove(cell); - // continue; - // } - // - // if (cell?.GetTile.GetColor != t.GetColor && cell?.GetTile.GetShape != t.GetShape) - // { - // return false; - // } - // } - // - // if(surroundingCells.Count == 0) return false; - // - // foreach (var cell in surroundingCells.ToList()) - // { - // var extendedCells = new List(); - // - // if (cell?.GetX == x && cell?.GetY == y + 1) - // { - // for (int i = 1; i < 7; i++) - // { - // if (b.GetCell(x, y + i)?.GetTile != null) - // { - // extendedCells.Add(b.GetCell(x, y + i)); - // } - // } - // } - // - // else if (cell?.GetX == x && cell?.GetY == y - 1) - // { - // for (int i = 1; i < 7; i++) - // { - // if (b.GetCell(x, y - i)?.GetTile != null) - // { - // extendedCells.Add(b.GetCell(x, y - i)); - // } - // } - // } - // - // else if (cell?.GetX == x + 1 && cell?.GetY == y) - // { - // for (int i = 1; i < 7; i++) - // { - // if (b.GetCell(x + i, y)?.GetTile != null) - // { - // extendedCells.Add(b.GetCell(x + i, y)); - // } - // } - // } - // - // else if (cell?.GetX == x - 1 && cell?.GetY == y) - // { - // for (int i = 1; i < 7; i++) - // { - // if (b.GetCell(x - i, y)?.GetTile != null) - // { - // extendedCells.Add(b.GetCell(x - i, y)); - // } - // } - // } - // - // foreach (var e in extendedCells) - // { - // if (e?.GetTile?.GetColor != t.GetColor && e?.GetTile?.GetShape != t.GetShape) - // { - // return false; - // } - // } - // - // if (extendedCells.Count == 6) - // { - // return false; - // } - // } - // - // return true; - // } - public bool IsMoveCorrect(Tile t, int x, int y, Board b) { if (!b.HasOccupiedCase())