diff --git a/source/Trek-12/Models/Events/CellChosenEventArgs.cs b/source/Trek-12/Models/Events/CellChosenEventArgs.cs
index 24f0a35..9c2040c 100644
--- a/source/Trek-12/Models/Events/CellChosenEventArgs.cs
+++ b/source/Trek-12/Models/Events/CellChosenEventArgs.cs
@@ -1,17 +1,19 @@
using Models.Game;
-namespace Models.Events;
-///
-/// Event arguments for when a cell is chosen.
-///
-public class CellChosenEventArgs : EventArgs
+namespace Models.Events
{
- public Cell Cell { get; }
- public int Result { get; }
-
- public CellChosenEventArgs(Cell cell, int result)
+ ///
+ /// Event arguments for when a cell is chosen.
+ ///
+ public class CellChosenEventArgs : EventArgs
{
- Cell = cell;
- Result = result;
+ public Cell Cell { get; }
+ public int Result { get; }
+
+ public CellChosenEventArgs(Cell cell, int result)
+ {
+ Cell = cell;
+ Result = result;
+ }
}
}
\ No newline at end of file
diff --git a/source/Trek-12/Models/Events/DiceRolledEventArgs.cs b/source/Trek-12/Models/Events/DiceRolledEventArgs.cs
index a1b6da1..fd77f54 100644
--- a/source/Trek-12/Models/Events/DiceRolledEventArgs.cs
+++ b/source/Trek-12/Models/Events/DiceRolledEventArgs.cs
@@ -1,17 +1,19 @@
using Models.Game;
-namespace Models.Events;
-///
-/// Event arguments for when the dice are rolled.
-///
-public class DiceRolledEventArgs : EventArgs
+namespace Models.Events
{
- public int Dice1Value { get; }
- public int Dice2Value { get; }
-
- public DiceRolledEventArgs(int dice1Value, int dice2Value)
+ ///
+ /// Event arguments for when the dice are rolled.
+ ///
+ public class DiceRolledEventArgs : EventArgs
{
- Dice1Value = dice1Value;
- Dice2Value = dice2Value;
- }
-}
\ No newline at end of file
+ public int Dice1Value { get; }
+ public int Dice2Value { get; }
+
+ public DiceRolledEventArgs(int dice1Value, int dice2Value)
+ {
+ Dice1Value = dice1Value;
+ Dice2Value = dice2Value;
+ }
+ }
+}
diff --git a/source/Trek-12/Models/Events/GameEndedEventArgs.cs b/source/Trek-12/Models/Events/GameEndedEventArgs.cs
index 31319f1..7148eeb 100644
--- a/source/Trek-12/Models/Events/GameEndedEventArgs.cs
+++ b/source/Trek-12/Models/Events/GameEndedEventArgs.cs
@@ -1,15 +1,17 @@
using Models.Game;
-namespace Models.Events;
-///
-/// Event arguments for when the game ends.
-///
-public class GameEndedEventArgs : EventArgs
+namespace Models.Events
{
- public Player CurrentPlayer { get; }
-
- public GameEndedEventArgs(Player winner)
+ ///
+ /// Event arguments for when the game ends.
+ ///
+ public class GameEndedEventArgs : EventArgs
{
- CurrentPlayer = winner;
+ public Player CurrentPlayer { get; }
+
+ public GameEndedEventArgs(Player winner)
+ {
+ CurrentPlayer = winner;
+ }
}
-}
\ No newline at end of file
+}
diff --git a/source/Trek-12/Models/Events/GameStartedEventArgs.cs b/source/Trek-12/Models/Events/GameStartedEventArgs.cs
index f2bfeac..1f1e157 100644
--- a/source/Trek-12/Models/Events/GameStartedEventArgs.cs
+++ b/source/Trek-12/Models/Events/GameStartedEventArgs.cs
@@ -1,15 +1,18 @@
using Models.Game;
-namespace Models.Events;
-///
-/// Event arguments for when the game starts.
-///
-public class GameStartedEventArgs : EventArgs
+namespace Models.Events
{
- public Player CurrentPlayer { get; }
-
- public GameStartedEventArgs(Player selectedPlayer)
+ ///
+ /// Event arguments for when the game starts.
+ ///
+ public class GameStartedEventArgs : EventArgs
{
- CurrentPlayer = selectedPlayer;
+ public Player CurrentPlayer { get; }
+
+ public GameStartedEventArgs(Player selectedPlayer)
+ {
+ CurrentPlayer = selectedPlayer;
+ }
}
-}
\ No newline at end of file
+}
+
diff --git a/source/Trek-12/Models/Events/OperationChosenEventArgs.cs b/source/Trek-12/Models/Events/OperationChosenEventArgs.cs
index a200bf7..af43c76 100644
--- a/source/Trek-12/Models/Events/OperationChosenEventArgs.cs
+++ b/source/Trek-12/Models/Events/OperationChosenEventArgs.cs
@@ -1,17 +1,19 @@
using Models.Game;
-namespace Models.Events;
-///
-/// Event arguments for when an operation is chosen.
-///
-public class OperationChosenEventArgs : EventArgs
+namespace Models.Events
{
- public Operation Operation { get; }
- public int Result { get; }
-
- public OperationChosenEventArgs(Operation operation, int result)
+ ///
+ /// Event arguments for when an operation is chosen.
+ ///
+ public class OperationChosenEventArgs : EventArgs
{
- Operation = operation;
- Result = result;
+ public Operation Operation { get; }
+ public int Result { get; }
+
+ public OperationChosenEventArgs(Operation operation, int result)
+ {
+ Operation = operation;
+ Result = result;
+ }
}
}
\ No newline at end of file
diff --git a/source/Trek-12/Models/Exceptions/InvalidCellCoordinatesException.cs b/source/Trek-12/Models/Exceptions/InvalidCellCoordinatesException.cs
index 998794a..4f4e53d 100644
--- a/source/Trek-12/Models/Exceptions/InvalidCellCoordinatesException.cs
+++ b/source/Trek-12/Models/Exceptions/InvalidCellCoordinatesException.cs
@@ -1,9 +1,11 @@
-namespace Models.Exceptions;
-
-///
-/// Exception for when the cell coordinates are invalid.
-///
-public class InvalidCellCoordinatesException : Exception
+namespace Models.Exceptions
{
- public InvalidCellCoordinatesException(string message) : base(message) { }
-}
\ No newline at end of file
+ ///
+ /// 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
index 2c46533..7556c26 100644
--- a/source/Trek-12/Models/Exceptions/InvalidCellException.cs
+++ b/source/Trek-12/Models/Exceptions/InvalidCellException.cs
@@ -1,9 +1,11 @@
-namespace Models.Exceptions;
-
-///
-/// Exception for when the cell is invalid.
-///
-public class InvalidCellException : Exception
+namespace Models.Exceptions
{
- public InvalidCellException(string message) : base(message) { }
-}
\ No newline at end of file
+ ///
+ /// Exception for when the cell is invalid.
+ ///
+ public class InvalidCellException : Exception
+ {
+ public InvalidCellException(string message) : base(message) { }
+ }
+}
+
diff --git a/source/Trek-12/Models/Game/Cell.cs b/source/Trek-12/Models/Game/Cell.cs
index b28299f..49fe4bb 100644
--- a/source/Trek-12/Models/Game/Cell.cs
+++ b/source/Trek-12/Models/Game/Cell.cs
@@ -1,63 +1,64 @@
-namespace Models.Game;
-
-///
-/// The Cell class represents a cell in the application.
-///
-public class Cell : Position, IEquatable
+namespace Models.Game
{
///
- /// The value of the cell.
+ /// The Cell class represents a cell in the application.
///
- private int? _value;
- public int? Value {
- get => _value;
- set
- {
- if (value < 0)
+ public class Cell : Position, IEquatable
+ {
+ ///
+ /// The value of the cell.
+ ///
+ private int? _value;
+ public int? Value {
+ get => _value;
+ set
{
- throw new Exception("La valeur doit être supérieure à 0");
+ if (value < 0)
+ {
+ throw new Exception("La valeur doit être supérieure à 0");
+ }
+ this._value = value;
}
- this._value = value;
}
- }
- ///
- /// The fact that the cell is dangerous or not.
- ///
- private bool IsDangerous { get; set; }
+ ///
+ /// The fact that the cell is dangerous or not.
+ ///
+ private bool IsDangerous { get; set; }
- ///
- /// Atribute to know if the cell is a penalty cell.
- ///
- private bool Penalty { get; set; }
+ ///
+ /// Atribute to know if the cell is a penalty cell.
+ ///
+ private bool Penalty { get; set; }
- ///
- /// Constructor of the Cell class.
- ///
- /// the x position
- /// the y position
- /// if the cell is a dangerous cell or not
- public Cell(int x, int y,bool isDangerous = false):base(x,y)
- {
- IsDangerous = isDangerous;
- Penalty = false;
- }
+ ///
+ /// Constructor of the Cell class.
+ ///
+ /// the x position
+ /// the y position
+ /// if the cell is a dangerous cell or not
+ public Cell(int x, int y,bool isDangerous = false):base(x,y)
+ {
+ IsDangerous = isDangerous;
+ Penalty = false;
+ }
- ///
- /// Function in order to return the fact that the cell is dangerous or not.
- ///
- /// If the cell is dangerous or not
- public bool GetCellType() => IsDangerous;
+ ///
+ /// Function in order to return the fact that the cell is dangerous or not.
+ ///
+ /// If the cell is dangerous or not
+ public bool GetCellType() => IsDangerous;
- ///
- /// Redefine the equal operation between cells.
- ///
- /// The object to compare with the current cell.
- /// true if the specified object is equal to the current cell; otherwise, false.
- public bool Equals(Cell? other)
- {
- if (other == null) return false;
- if (this.X == other.X && this.Y == other.Y) return true;
- return false;
+ ///
+ /// Redefine the equal operation between cells.
+ ///
+ /// The object to compare with the current cell.
+ /// true if the specified object is equal to the current cell; otherwise, false.
+ public bool Equals(Cell? other)
+ {
+ if (other == null) return false;
+ if (this.X == other.X && this.Y == other.Y) return true;
+ return false;
+ }
}
}
\ No newline at end of file
diff --git a/source/Trek-12/Models/Game/Map.cs b/source/Trek-12/Models/Game/Map.cs
index 04f727f..56dbb69 100644
--- a/source/Trek-12/Models/Game/Map.cs
+++ b/source/Trek-12/Models/Game/Map.cs
@@ -1,76 +1,78 @@
-namespace Models.Game;
-
-///
-/// The Map class is the representation of the game map with the board and the operations table.
-///
-public class Map
+namespace Models.Game
{
- ///
- /// It is the list of cells on the map.
- ///
- public List Boards { get; private set; }
-
- ///
- /// It is the backgrond image of the map
- ///
- public string Background { get; private set; }
///
- /// It is the grid of the possible operation in the game
+ /// The Map class is the representation of the game map with the board and the operations table.
///
- public List OperationGrid { get; private set; }
+ public class Map
+ {
+ ///
+ /// It is the list of cells on the map.
+ ///
+ public List Boards { get; private set; }
+
+ ///
+ /// It is the backgrond image of the map
+ ///
+ public string Background { get; private set; }
- ///
- /// It is a list of a list containing user's rope paths in the current game
- ///
- public List> RopePaths { get; private set; }
+ ///
+ /// It is the grid of the possible operation in the game
+ ///
+ public List OperationGrid { get; private set; }
- ///
- /// It is a list of a list containing user's zones in the current game
- ///
- public List> Zones { get; private set; }
+ ///
+ /// It is a list of a list containing user's rope paths in the current game
+ ///
+ public List> RopePaths { get; private set; }
- ///
- /// Initializes a new instance of the Map class.
- ///
- /// The background of the map.
- public Map(string background)
- {
- Boards = InitializeBoards();
- Background = background;
- OperationGrid = InitializeOperationGrid();
- RopePaths = new List>();
- Zones = new List>();
- }
+ ///
+ /// It is a list of a list containing user's zones in the current game
+ ///
+ public List> Zones { get; private set; }
- ///
- /// Initializes the boards of the map.
- ///
- /// Return the boards
- private List InitializeBoards()
- {
- var boards = new List();
- for (int i = 0; i < 36; i++) // 6x6 board
+ ///
+ /// Initializes a new instance of the Map class.
+ ///
+ /// The background of the map.
+ public Map(string background)
{
- boards.Add(new Cell(i / 6, i % 6));
+ Boards = InitializeBoards();
+ Background = background;
+ OperationGrid = InitializeOperationGrid();
+ RopePaths = new List>();
+ Zones = new List>();
}
- return boards;
- }
-
- ///
- /// Initializes the operation grid of the map.
- ///
- /// Return the operation grid
- private List InitializeOperationGrid()
- {
- var operationGrid = new List();
- for (int i = 0; i < 5; i++) // 5 operations
+
+ ///
+ /// Initializes the boards of the map.
+ ///
+ /// Return the boards
+ private List InitializeBoards()
+ {
+ var boards = new List();
+ for (int i = 0; i < 36; i++) // 6x6 board
+ {
+ boards.Add(new Cell(i / 6, i % 6));
+ }
+ return boards;
+ }
+
+ ///
+ /// Initializes the operation grid of the map.
+ ///
+ /// Return the operation grid
+ private List InitializeOperationGrid()
{
- for (int j = 0; j < 4; j++) // 4 cells per operation
+ var operationGrid = new List();
+ for (int i = 0; i < 5; i++) // 5 operations
{
- operationGrid.Add(new OperationCell(i, j));
+ for (int j = 0; j < 4; j++) // 4 cells per operation
+ {
+ operationGrid.Add(new OperationCell(i, j));
+ }
}
+ return operationGrid;
}
- return operationGrid;
}
-}
+}
\ No newline at end of file
diff --git a/source/Trek-12/Models/Game/OperationCell.cs b/source/Trek-12/Models/Game/OperationCell.cs
index baffc98..d8ac6da 100644
--- a/source/Trek-12/Models/Game/OperationCell.cs
+++ b/source/Trek-12/Models/Game/OperationCell.cs
@@ -1,28 +1,30 @@
-namespace Models.Game;
-
-///
-/// Represents a cell in the operation grid of the game.
-///
-public class OperationCell : Position
+namespace Models.Game
{
///
- /// It tells if the operation is checked or not in the operation grid of the game.
- ///
- public bool IsChecked { get; private set; }
-
- ///
- /// Constructor of the OperationCell class.
+ /// Represents a cell in the operation grid of the game.
///
- ///
- ///
- public OperationCell (int x,int y) :base (x,y)
- { }
-
- ///
- /// Check the operation cell.
- ///
- public void Check()
+ public class OperationCell : Position
{
- IsChecked = true;
+ ///
+ /// It tells if the operation is checked or not in the operation grid of the game.
+ ///
+ public bool IsChecked { get; private set; }
+
+ ///
+ /// Constructor of the OperationCell class.
+ ///
+ ///
+ ///
+ public OperationCell(int x, int y) : base(x, y)
+ {
+ }
+
+ ///
+ /// Check the operation cell.
+ ///
+ public void Check()
+ {
+ IsChecked = true;
+ }
}
}
\ No newline at end of file
diff --git a/source/Trek-12/Models/Game/Player.cs b/source/Trek-12/Models/Game/Player.cs
index d9c9d13..f363eb4 100644
--- a/source/Trek-12/Models/Game/Player.cs
+++ b/source/Trek-12/Models/Game/Player.cs
@@ -1,80 +1,82 @@
-namespace Models.Game;
-
-///
-/// Represents a player in the game.
-///
-public class Player
+namespace Models.Game
{
- ///
- /// It is he pseudo of the player.
- ///
- public string Pseudo { get; private set; }
///
- /// It is the profile picture of the player.
+ /// Represents a player in the game.
///
- public string ProfilePicture { get; private set; }
+ public class Player
+ {
+ ///
+ /// It is he pseudo of the player.
+ ///
+ public string Pseudo { get; private set; }
- ///
- /// It is the creation date of the player.
- ///
- public string? CreationDate { get; private set; }
+ ///
+ /// It is the profile picture of the player.
+ ///
+ public string ProfilePicture { get; private set; }
- ///
- /// It tells when was the last time the player played.
- ///
- public string? LastPlayed { get; private set; }
+ ///
+ /// It is the creation date of the player.
+ ///
+ public string? CreationDate { get; private set; }
- ///
- /// Constructor with default values.
- ///
- public Player()
- {
- Pseudo = "Player";
- ProfilePicture = "DefaultProfilePicture";
- }
+ ///
+ /// It tells when was the last time the player played.
+ ///
+ public string? LastPlayed { get; private set; }
- ///
- /// Construct a new instance of Player with specified pseudo and profile picture.
- ///
- /// The pseudo of the player.
- /// The profile picture of the player.
- public Player(string pseudo, string profilePicture = "DefaultProfilePicture")
- {
- Pseudo = pseudo;
- ProfilePicture = profilePicture;
- }
+ ///
+ /// Constructor with default values.
+ ///
+ public Player()
+ {
+ Pseudo = "Player";
+ ProfilePicture = "DefaultProfilePicture";
+ }
- ///
- /// Chooses the operation for the player.
- ///
- /// The chosen operation.
- public Operation ChooseOperation()
- {
- return Operation.LOWER;
- }
+ ///
+ /// Construct a new instance of Player with specified pseudo and profile picture.
+ ///
+ /// The pseudo of the player.
+ /// The profile picture of the player.
+ public Player(string pseudo, string profilePicture = "DefaultProfilePicture")
+ {
+ Pseudo = pseudo;
+ ProfilePicture = profilePicture;
+ }
- ///
- /// Redefine the equal operation between player.
- ///
- /// The object to compare with the current player.
- /// true if the specified object is equal to the current player; otherwise, false.
- public override bool Equals(object? obj)
- {
- if (obj == null || GetType() != obj.GetType())
+ ///
+ /// Chooses the operation for the player.
+ ///
+ /// The chosen operation.
+ public Operation ChooseOperation()
{
- return false;
+ return Operation.LOWER;
}
- Player c = (Player)obj;
- return (Pseudo == c.Pseudo);
- }
- ///
- /// Returns the hash code for the current player, in order for the Equals operation to work
- ///
- /// The hash code for the current player.
- public override int GetHashCode()
- {
- return Pseudo.GetHashCode();
+ ///
+ /// Redefine the equal operation between player.
+ ///
+ /// The object to compare with the current player.
+ /// true if the specified object is equal to the current player; otherwise, false.
+ public override bool Equals(object? obj)
+ {
+ if (obj == null || GetType() != obj.GetType())
+ {
+ return false;
+ }
+ Player c = (Player)obj;
+ return (Pseudo == c.Pseudo);
+ }
+
+ ///
+ /// Returns the hash code for the current player, in order for the Equals operation to work
+ ///
+ /// The hash code for the current player.
+ public override int GetHashCode()
+ {
+ return Pseudo.GetHashCode();
+ }
}
}
\ No newline at end of file
diff --git a/source/Trek-12/Models/Game/Position.cs b/source/Trek-12/Models/Game/Position.cs
index 05193fa..c1b75da 100644
--- a/source/Trek-12/Models/Game/Position.cs
+++ b/source/Trek-12/Models/Game/Position.cs
@@ -1,28 +1,30 @@
-namespace Models.Game;
-
-///
-/// The Position (x,y) of a cell in the game.
-///
-public class Position
+namespace Models.Game
{
- ///
- /// The X coordinate.
- ///
- public int X { get; set; }
-
- ///
- /// The Y coordinate.
- ///
- public int Y { get; set; }
///
- /// Constructor of the Position class.
+ /// The Position (x,y) of a cell in the game.
///
- /// The X coordinate.
- /// The Y coordinate.
- public Position(int x, int y)
+ public class Position
{
- X = x;
- Y = y;
+ ///
+ /// The X coordinate.
+ ///
+ public int X { get; set; }
+
+ ///
+ /// The Y coordinate.
+ ///
+ public int Y { get; set; }
+
+ ///
+ /// Constructor of the Position class.
+ ///
+ /// The X coordinate.
+ /// The Y coordinate.
+ public Position(int x, int y)
+ {
+ X = x;
+ Y = y;
+ }
}
-}
+}
\ No newline at end of file
diff --git a/source/Trek-12/Models/Interfaces/IRules.cs b/source/Trek-12/Models/Interfaces/IRules.cs
index 7a9cffe..1b9cb8d 100644
--- a/source/Trek-12/Models/Interfaces/IRules.cs
+++ b/source/Trek-12/Models/Interfaces/IRules.cs
@@ -1,126 +1,128 @@
using Models.Game;
-namespace Models.Interfaces;
-
-///
-/// Interface for the rules of the game.
-///
-public interface IRules
+namespace Models.Interfaces
{
- //public bool NearCellIsValid(Position playerChoicePosition, SortedDictionary cells);
-
- ///
- /// Return true if the cell is empty, otherwise false.
- ///
- /// The cell that the player chose
- /// Return true if the cell is empty, otherwise false.
- public bool IsCellEmpty(Cell playerChoice);
-
- ///
- /// Check if the cell is valid.
- ///
- /// The cell that the player chose
- /// Boards of the actual game
- /// 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.
- ///
- /// The chosen cell.
- /// The target cell.
- /// True if the given cell is adjacent to the target cell; otherwise false.
- public bool IsCellAdjacent(Cell choosenCell, Cell targetCell);
-
- ///
- /// Check if the given cell can be played there.
- /// If there isn't any adjacent cell with a value, or if the cell is null, it returns false.
- ///
- /// The chosen cell.
- /// The list of cells.
- /// True if the chosen cell can be played here; otherwise false.
- public bool NearCellIsValid(Cell choosenCell, List cells);
-
- ///
- /// Check if the chosen cell is valid and add it to the matching zone.
- /// If there is a nearby cell with matching value but no zone already created, it creates one
- ///
- /// The chosen cell.
- /// The map.
- ///
- public void IsZoneValidAndAddToZones(Cell chosenCell, Map map);
-
- ///
- /// Check if the value of the chosen cell is in the zones of the player.
- ///
- /// The cell chosen by the player.
- /// The list of the player's zones.
- /// True if the value is in the zones; otherwise false.
- public bool IsValueInZones(Cell chosenCell, List> zones);
-
- ///
- /// Check if the chosen cell is in any of the player's zones.
- ///
- /// The chosen cell.
- /// The list of the player's zones.
- /// True if the cell is in any of the zones; otherwise false.
- public bool IsCellInZone(Cell chosenCell, List> zones);
-
- ///
- /// Add the chosen cell to the list of zones.
- /// The zone must be created before.
- ///
- /// The chosen cell.
- /// The list of zones.
- public void AddToZone(Cell chosenCell, List> zones);
-
- ///
- /// Create a new zone with the two cells and add it to the map.
- ///
- /// The first cell.
- /// The second cell.
- /// The map.
- public void NewZoneIsCreated(Cell firstCell, Cell secondCell, Map map);
-
- ///
- /// Get every adjacent cell of the chosen cell.
- ///
- /// The chosen cell.
- /// The list of cells.
- /// The list of adjacent cells.
- public List EveryAdjacentCells(Cell choosenCell, List cells);
-
- ///
- /// Calculate the final score by summing up the values of all the zones.
- ///
- /// The list of zones.
- /// The final score.
- public int? FinalCalculusOfZones(List> zones);
-
- ///
- /// Check if the adjacent cell is in any of the rope paths.
- ///
- /// The adjacent cell.
- /// The list of rope paths.
- /// The index of the rope path.
- /// True if the adjacent cell is in the rope path; otherwise false.
- public bool IsInRopePaths(Cell adjacente, List> ropePaths, int index);
///
- /// Check if the chosen cell has the same value as the rope path at the given index.
+ /// Interface for the rules of the game.
///
- /// The chosen cell.
- /// The list of rope paths.
- /// The index of the rope path.
- /// True if the chosen cell has the same value as the rope path; otherwise false.
- public bool AsValue(Cell choosenCell, List> ropePaths, int index);
-}
+ public interface IRules
+ {
+ //public bool NearCellIsValid(Position playerChoicePosition, SortedDictionary cells);
+
+ ///
+ /// Return true if the cell is empty, otherwise false.
+ ///
+ /// The cell that the player chose
+ /// Return true if the cell is empty, otherwise false.
+ public bool IsCellEmpty(Cell playerChoice);
+
+ ///
+ /// Check if the cell is valid.
+ ///
+ /// The cell that the player chose
+ /// Boards of the actual game
+ /// 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.
+ ///
+ /// The chosen cell.
+ /// The target cell.
+ /// True if the given cell is adjacent to the target cell; otherwise false.
+ public bool IsCellAdjacent(Cell choosenCell, Cell targetCell);
+
+ ///
+ /// Check if the given cell can be played there.
+ /// If there isn't any adjacent cell with a value, or if the cell is null, it returns false.
+ ///
+ /// The chosen cell.
+ /// The list of cells.
+ /// True if the chosen cell can be played here; otherwise false.
+ public bool NearCellIsValid(Cell choosenCell, List cells);
+
+ ///
+ /// Check if the chosen cell is valid and add it to the matching zone.
+ /// If there is a nearby cell with matching value but no zone already created, it creates one
+ ///
+ /// The chosen cell.
+ /// The map.
+ ///
+ public void IsZoneValidAndAddToZones(Cell chosenCell, Map map);
+
+ ///
+ /// Check if the value of the chosen cell is in the zones of the player.
+ ///
+ /// The cell chosen by the player.
+ /// The list of the player's zones.
+ /// True if the value is in the zones; otherwise false.
+ public bool IsValueInZones(Cell chosenCell, List> zones);
+
+ ///
+ /// Check if the chosen cell is in any of the player's zones.
+ ///
+ /// The chosen cell.
+ /// The list of the player's zones.
+ /// True if the cell is in any of the zones; otherwise false.
+ public bool IsCellInZone(Cell chosenCell, List> zones);
+
+ ///
+ /// Add the chosen cell to the list of zones.
+ /// The zone must be created before.
+ ///
+ /// The chosen cell.
+ /// The list of zones.
+ public void AddToZone(Cell chosenCell, List> zones);
+
+ ///
+ /// Create a new zone with the two cells and add it to the map.
+ ///
+ /// The first cell.
+ /// The second cell.
+ /// The map.
+ public void NewZoneIsCreated(Cell firstCell, Cell secondCell, Map map);
+
+ ///
+ /// Get every adjacent cell of the chosen cell.
+ ///
+ /// The chosen cell.
+ /// The list of cells.
+ /// The list of adjacent cells.
+ public List EveryAdjacentCells(Cell choosenCell, List cells);
+
+ ///
+ /// Calculate the final score by summing up the values of all the zones.
+ ///
+ /// The list of zones.
+ /// The final score.
+ public int? FinalCalculusOfZones(List> zones);
+
+ ///
+ /// Check if the adjacent cell is in any of the rope paths.
+ ///
+ /// The adjacent cell.
+ /// The list of rope paths.
+ /// The index of the rope path.
+ /// True if the adjacent cell is in the rope path; otherwise false.
+ public bool IsInRopePaths(Cell adjacente, List> ropePaths, int index);
+
+ ///
+ /// Check if the chosen cell has the same value as the rope path at the given index.
+ ///
+ /// The chosen cell.
+ /// The list of rope paths.
+ /// The index of the rope path.
+ /// True if the chosen cell has the same value as the rope path; otherwise false.
+ public bool AsValue(Cell choosenCell, List> ropePaths, int index);
+ }
+}
\ No newline at end of file
| | | | | | | | | | | | | | | |