From 371948095e7c956b33eb65320d89aebe9a10aa60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi?= Date: Sat, 8 Jun 2024 11:54:07 +0200 Subject: [PATCH] =?UTF-8?q?Suppression=20des=20choses=20non=20utilis=C3=A9?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InvalidCellCoordinatesException.cs | 11 ----- .../Models/Exceptions/InvalidCellException.cs | 11 ----- .../Exceptions/InvalidPlaceResultException.cs | 11 ----- source/Trek-12/Models/Interfaces/IRules.cs | 11 ----- source/Trek-12/Models/Rules/Rules.cs | 41 +------------------ 5 files changed, 1 insertion(+), 84 deletions(-) delete mode 100644 source/Trek-12/Models/Exceptions/InvalidCellCoordinatesException.cs delete mode 100644 source/Trek-12/Models/Exceptions/InvalidCellException.cs delete mode 100644 source/Trek-12/Models/Exceptions/InvalidPlaceResultException.cs diff --git a/source/Trek-12/Models/Exceptions/InvalidCellCoordinatesException.cs b/source/Trek-12/Models/Exceptions/InvalidCellCoordinatesException.cs deleted file mode 100644 index 4f4e53d..0000000 --- a/source/Trek-12/Models/Exceptions/InvalidCellCoordinatesException.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Models.Exceptions -{ - /// - /// Exception for when the cell coordinates are invalid. - /// - public class InvalidCellCoordinatesException : Exception - { - public InvalidCellCoordinatesException(string message) : base(message) { } - } -} - diff --git a/source/Trek-12/Models/Exceptions/InvalidCellException.cs b/source/Trek-12/Models/Exceptions/InvalidCellException.cs deleted file mode 100644 index 7556c26..0000000 --- a/source/Trek-12/Models/Exceptions/InvalidCellException.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Models.Exceptions -{ - /// - /// Exception for when the cell is invalid. - /// - public class InvalidCellException : Exception - { - public InvalidCellException(string message) : base(message) { } - } -} - diff --git a/source/Trek-12/Models/Exceptions/InvalidPlaceResultException.cs b/source/Trek-12/Models/Exceptions/InvalidPlaceResultException.cs deleted file mode 100644 index de8fdd0..0000000 --- a/source/Trek-12/Models/Exceptions/InvalidPlaceResultException.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Models.Exceptions -{ - /// - /// Exception for when the cell is invalid. - /// - public class InvalidPlaceResultException : Exception - { - public InvalidPlaceResultException(string message) : base(message) { } - } -} - diff --git a/source/Trek-12/Models/Interfaces/IRules.cs b/source/Trek-12/Models/Interfaces/IRules.cs index 1b9cb8d..c2dbd70 100644 --- a/source/Trek-12/Models/Interfaces/IRules.cs +++ b/source/Trek-12/Models/Interfaces/IRules.cs @@ -8,8 +8,6 @@ namespace Models.Interfaces /// public interface IRules { - //public bool NearCellIsValid(Position playerChoicePosition, SortedDictionary cells); - /// /// Return true if the cell is empty, otherwise false. /// @@ -25,15 +23,6 @@ namespace Models.Interfaces /// true if the cell is valid; otherwise, false public bool IsCellValid(Cell playerChoicePosition, List cells); - //public bool IsRopePath(Cell playerChoice, HashSet ropePaths); - - //public bool IsAdjacent(Cell cell1, Cell cell2, List cells); - - //public int HowMany(Cell playerChoice, List cells); - - //public void SetValueAndPenalty(int valueChoice, Cell playerChoice, List cells); - - /// /// Check if the given cell is adjacent to the target cell. /// diff --git a/source/Trek-12/Models/Rules/Rules.cs b/source/Trek-12/Models/Rules/Rules.cs index 7e17b3e..54a29e4 100644 --- a/source/Trek-12/Models/Rules/Rules.cs +++ b/source/Trek-12/Models/Rules/Rules.cs @@ -29,26 +29,7 @@ namespace Models.Rules return true; } - - //public bool IsCellAdjacent(Cell choosenCell, Cell targetCell) - //{ - // if (Math.Abs(choosenCell.X - targetCell.X) > 1 || Math.Abs(choosenCell.Y - targetCell.Y) > 1) - // return false; - // if (Math.Abs(choosenCell.X - targetCell.X) > 1 && Math.Abs(choosenCell.Y - targetCell.Y) > 1) - // return false; - // if (choosenCell.X == 0 && targetCell.X == 4) - // return false; - // if (choosenCell.Y == 0 && targetCell.Y == 4) - // return false; - // if (choosenCell.X == 4 && targetCell.X == 0) - // return false; - // if (choosenCell.Y == 4 && targetCell.Y == 0) - // return false; - // if (choosenCell.X == targetCell.X && choosenCell.Y == targetCell.Y) - // return false; - - // return true; - //} + public bool IsCellAdjacent(Cell choosenCell, Cell targetCell) { @@ -85,24 +66,6 @@ namespace Models.Rules } return false; } - //public bool NearCellIsValid(Cell choosenCell, List cells) - //{ - // if (choosenCell == null || cells == null) return false; - - // IEnumerable PlayedCellsQuery = - // from cell in cells - // where cell.Value != null - // select cell; - - // foreach (var cell in PlayedCellsQuery) - // { - // if(!IsCellAdjacent(choosenCell, cell)) continue; - - // return true; - // } - - // return false; - //} public bool NearCellIsValid(Cell choosenCell, List cells) { @@ -145,8 +108,6 @@ namespace Models.Rules { NewZoneIsCreated(chosenCell, cells, map); } - //return true; // Il y a une cellule adjacente avec la même valeur donc une zone est créée si elle n'est pas déjà existante - // Si il return true, tout c'est bien passer } }