Correction d'un problème d'indentation
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is failing Details

pull/67/head
Rémi LAVERGNE 11 months ago
parent cb5edd97af
commit 1714634f47
No known key found for this signature in database
GPG Key ID: CA264B55E97FD220

@ -1,17 +1,19 @@
using Models.Game;
namespace Models.Events;
/// <summary>
/// Event arguments for when a cell is chosen.
/// </summary>
public class CellChosenEventArgs : EventArgs
namespace Models.Events
{
public Cell Cell { get; }
public int Result { get; }
public CellChosenEventArgs(Cell cell, int result)
/// <summary>
/// Event arguments for when a cell is chosen.
/// </summary>
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;
}
}
}

@ -1,17 +1,19 @@
using Models.Game;
namespace Models.Events;
/// <summary>
/// Event arguments for when the dice are rolled.
/// </summary>
public class DiceRolledEventArgs : EventArgs
namespace Models.Events
{
public int Dice1Value { get; }
public int Dice2Value { get; }
public DiceRolledEventArgs(int dice1Value, int dice2Value)
/// <summary>
/// Event arguments for when the dice are rolled.
/// </summary>
public class DiceRolledEventArgs : EventArgs
{
Dice1Value = dice1Value;
Dice2Value = dice2Value;
}
}
public int Dice1Value { get; }
public int Dice2Value { get; }
public DiceRolledEventArgs(int dice1Value, int dice2Value)
{
Dice1Value = dice1Value;
Dice2Value = dice2Value;
}
}
}

@ -1,15 +1,17 @@
using Models.Game;
namespace Models.Events;
/// <summary>
/// Event arguments for when the game ends.
/// </summary>
public class GameEndedEventArgs : EventArgs
namespace Models.Events
{
public Player CurrentPlayer { get; }
public GameEndedEventArgs(Player winner)
/// <summary>
/// Event arguments for when the game ends.
/// </summary>
public class GameEndedEventArgs : EventArgs
{
CurrentPlayer = winner;
public Player CurrentPlayer { get; }
public GameEndedEventArgs(Player winner)
{
CurrentPlayer = winner;
}
}
}
}

@ -1,15 +1,18 @@
using Models.Game;
namespace Models.Events;
/// <summary>
/// Event arguments for when the game starts.
/// </summary>
public class GameStartedEventArgs : EventArgs
namespace Models.Events
{
public Player CurrentPlayer { get; }
public GameStartedEventArgs(Player selectedPlayer)
/// <summary>
/// Event arguments for when the game starts.
/// </summary>
public class GameStartedEventArgs : EventArgs
{
CurrentPlayer = selectedPlayer;
public Player CurrentPlayer { get; }
public GameStartedEventArgs(Player selectedPlayer)
{
CurrentPlayer = selectedPlayer;
}
}
}
}

@ -1,17 +1,19 @@
using Models.Game;
namespace Models.Events;
/// <summary>
/// Event arguments for when an operation is chosen.
/// </summary>
public class OperationChosenEventArgs : EventArgs
namespace Models.Events
{
public Operation Operation { get; }
public int Result { get; }
public OperationChosenEventArgs(Operation operation, int result)
/// <summary>
/// Event arguments for when an operation is chosen.
/// </summary>
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;
}
}
}

@ -1,9 +1,11 @@
namespace Models.Exceptions;
/// <summary>
/// Exception for when the cell coordinates are invalid.
/// </summary>
public class InvalidCellCoordinatesException : Exception
namespace Models.Exceptions
{
public InvalidCellCoordinatesException(string message) : base(message) { }
}
/// <summary>
/// Exception for when the cell coordinates are invalid.
/// </summary>
public class InvalidCellCoordinatesException : Exception
{
public InvalidCellCoordinatesException(string message) : base(message) { }
}
}

@ -1,9 +1,11 @@
namespace Models.Exceptions;
/// <summary>
/// Exception for when the cell is invalid.
/// </summary>
public class InvalidCellException : Exception
namespace Models.Exceptions
{
public InvalidCellException(string message) : base(message) { }
}
/// <summary>
/// Exception for when the cell is invalid.
/// </summary>
public class InvalidCellException : Exception
{
public InvalidCellException(string message) : base(message) { }
}
}

@ -1,63 +1,64 @@
namespace Models.Game;
/// <summary>
/// The Cell class represents a cell in the application.
/// </summary>
public class Cell : Position, IEquatable<Cell>
namespace Models.Game
{
/// <summary>
/// The value of the cell.
/// The Cell class represents a cell in the application.
/// </summary>
private int? _value;
public int? Value {
get => _value;
set
{
if (value < 0)
public class Cell : Position, IEquatable<Cell>
{
/// <summary>
/// The value of the cell.
/// </summary>
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;
}
}
/// <summary>
/// The fact that the cell is dangerous or not.
/// </summary>
private bool IsDangerous { get; set; }
/// <summary>
/// The fact that the cell is dangerous or not.
/// </summary>
private bool IsDangerous { get; set; }
/// <summary>
/// Atribute to know if the cell is a penalty cell.
/// </summary>
private bool Penalty { get; set; }
/// <summary>
/// Atribute to know if the cell is a penalty cell.
/// </summary>
private bool Penalty { get; set; }
/// <summary>
/// Constructor of the Cell class.
/// </summary>
/// <param name="x">the x position</param>
/// <param name="y">the y position</param>
/// <param name="isDangerous">if the cell is a dangerous cell or not</param>
public Cell(int x, int y,bool isDangerous = false):base(x,y)
{
IsDangerous = isDangerous;
Penalty = false;
}
/// <summary>
/// Constructor of the Cell class.
/// </summary>
/// <param name="x">the x position</param>
/// <param name="y">the y position</param>
/// <param name="isDangerous">if the cell is a dangerous cell or not</param>
public Cell(int x, int y,bool isDangerous = false):base(x,y)
{
IsDangerous = isDangerous;
Penalty = false;
}
/// <summary>
/// Function in order to return the fact that the cell is dangerous or not.
/// </summary>
/// <returns>If the cell is dangerous or not</returns>
public bool GetCellType() => IsDangerous;
/// <summary>
/// Function in order to return the fact that the cell is dangerous or not.
/// </summary>
/// <returns>If the cell is dangerous or not</returns>
public bool GetCellType() => IsDangerous;
/// <summary>
/// Redefine the equal operation between cells.
/// </summary>
/// <param name="other">The object to compare with the current cell.</param>
/// <returns>true if the specified object is equal to the current cell; otherwise, false.</returns>
public bool Equals(Cell? other)
{
if (other == null) return false;
if (this.X == other.X && this.Y == other.Y) return true;
return false;
/// <summary>
/// Redefine the equal operation between cells.
/// </summary>
/// <param name="other">The object to compare with the current cell.</param>
/// <returns>true if the specified object is equal to the current cell; otherwise, false.</returns>
public bool Equals(Cell? other)
{
if (other == null) return false;
if (this.X == other.X && this.Y == other.Y) return true;
return false;
}
}
}

@ -1,76 +1,78 @@
namespace Models.Game;
/// <summary>
/// The Map class is the representation of the game map with the board and the operations table.
/// </summary>
public class Map
namespace Models.Game
{
/// <summary>
/// It is the list of cells on the map.
/// </summary>
public List<Cell> Boards { get; private set; }
/// <summary>
/// It is the backgrond image of the map
/// </summary>
public string Background { get; private set; }
/// <summary>
/// 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.
/// </summary>
public List<OperationCell> OperationGrid { get; private set; }
public class Map
{
/// <summary>
/// It is the list of cells on the map.
/// </summary>
public List<Cell> Boards { get; private set; }
/// <summary>
/// It is the backgrond image of the map
/// </summary>
public string Background { get; private set; }
/// <summary>
/// It is a list of a list containing user's rope paths in the current game
/// </summary>
public List<List<Cell>> RopePaths { get; private set; }
/// <summary>
/// It is the grid of the possible operation in the game
/// </summary>
public List<OperationCell> OperationGrid { get; private set; }
/// <summary>
/// It is a list of a list containing user's zones in the current game
/// </summary>
public List<List<Cell>> Zones { get; private set; }
/// <summary>
/// It is a list of a list containing user's rope paths in the current game
/// </summary>
public List<List<Cell>> RopePaths { get; private set; }
/// <summary>
/// Initializes a new instance of the Map class.
/// </summary>
/// <param name="background">The background of the map.</param>
public Map(string background)
{
Boards = InitializeBoards();
Background = background;
OperationGrid = InitializeOperationGrid();
RopePaths = new List<List<Cell>>();
Zones = new List<List<Cell>>();
}
/// <summary>
/// It is a list of a list containing user's zones in the current game
/// </summary>
public List<List<Cell>> Zones { get; private set; }
/// <summary>
/// Initializes the boards of the map.
/// </summary>
/// <returns>Return the boards</returns>
private List<Cell> InitializeBoards()
{
var boards = new List<Cell>();
for (int i = 0; i < 36; i++) // 6x6 board
/// <summary>
/// Initializes a new instance of the Map class.
/// </summary>
/// <param name="background">The background of the map.</param>
public Map(string background)
{
boards.Add(new Cell(i / 6, i % 6));
Boards = InitializeBoards();
Background = background;
OperationGrid = InitializeOperationGrid();
RopePaths = new List<List<Cell>>();
Zones = new List<List<Cell>>();
}
return boards;
}
/// <summary>
/// Initializes the operation grid of the map.
/// </summary>
/// <returns>Return the operation grid</returns>
private List<OperationCell> InitializeOperationGrid()
{
var operationGrid = new List<OperationCell>();
for (int i = 0; i < 5; i++) // 5 operations
/// <summary>
/// Initializes the boards of the map.
/// </summary>
/// <returns>Return the boards</returns>
private List<Cell> InitializeBoards()
{
var boards = new List<Cell>();
for (int i = 0; i < 36; i++) // 6x6 board
{
boards.Add(new Cell(i / 6, i % 6));
}
return boards;
}
/// <summary>
/// Initializes the operation grid of the map.
/// </summary>
/// <returns>Return the operation grid</returns>
private List<OperationCell> InitializeOperationGrid()
{
for (int j = 0; j < 4; j++) // 4 cells per operation
var operationGrid = new List<OperationCell>();
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;
}
}
}

@ -1,28 +1,30 @@
namespace Models.Game;
/// <summary>
/// Represents a cell in the operation grid of the game.
/// </summary>
public class OperationCell : Position
namespace Models.Game
{
/// <summary>
/// It tells if the operation is checked or not in the operation grid of the game.
/// </summary>
public bool IsChecked { get; private set; }
/// <summary>
/// Constructor of the OperationCell class.
/// Represents a cell in the operation grid of the game.
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
public OperationCell (int x,int y) :base (x,y)
{ }
/// <summary>
/// Check the operation cell.
/// </summary>
public void Check()
public class OperationCell : Position
{
IsChecked = true;
/// <summary>
/// It tells if the operation is checked or not in the operation grid of the game.
/// </summary>
public bool IsChecked { get; private set; }
/// <summary>
/// Constructor of the OperationCell class.
/// </summary>
/// <param name="x"></param>
/// <param name="y"></param>
public OperationCell(int x, int y) : base(x, y)
{
}
/// <summary>
/// Check the operation cell.
/// </summary>
public void Check()
{
IsChecked = true;
}
}
}

@ -1,80 +1,82 @@
namespace Models.Game;
/// <summary>
/// Represents a player in the game.
/// </summary>
public class Player
namespace Models.Game
{
/// <summary>
/// It is he pseudo of the player.
/// </summary>
public string Pseudo { get; private set; }
/// <summary>
/// It is the profile picture of the player.
/// Represents a player in the game.
/// </summary>
public string ProfilePicture { get; private set; }
public class Player
{
/// <summary>
/// It is he pseudo of the player.
/// </summary>
public string Pseudo { get; private set; }
/// <summary>
/// It is the creation date of the player.
/// </summary>
public string? CreationDate { get; private set; }
/// <summary>
/// It is the profile picture of the player.
/// </summary>
public string ProfilePicture { get; private set; }
/// <summary>
/// It tells when was the last time the player played.
/// </summary>
public string? LastPlayed { get; private set; }
/// <summary>
/// It is the creation date of the player.
/// </summary>
public string? CreationDate { get; private set; }
/// <summary>
/// Constructor with default values.
/// </summary>
public Player()
{
Pseudo = "Player";
ProfilePicture = "DefaultProfilePicture";
}
/// <summary>
/// It tells when was the last time the player played.
/// </summary>
public string? LastPlayed { get; private set; }
/// <summary>
/// Construct a new instance of Player with specified pseudo and profile picture.
/// </summary>
/// <param name="pseudo">The pseudo of the player.</param>
/// <param name="profilePicture">The profile picture of the player.</param>
public Player(string pseudo, string profilePicture = "DefaultProfilePicture")
{
Pseudo = pseudo;
ProfilePicture = profilePicture;
}
/// <summary>
/// Constructor with default values.
/// </summary>
public Player()
{
Pseudo = "Player";
ProfilePicture = "DefaultProfilePicture";
}
/// <summary>
/// Chooses the operation for the player.
/// </summary>
/// <returns>The chosen operation.</returns>
public Operation ChooseOperation()
{
return Operation.LOWER;
}
/// <summary>
/// Construct a new instance of Player with specified pseudo and profile picture.
/// </summary>
/// <param name="pseudo">The pseudo of the player.</param>
/// <param name="profilePicture">The profile picture of the player.</param>
public Player(string pseudo, string profilePicture = "DefaultProfilePicture")
{
Pseudo = pseudo;
ProfilePicture = profilePicture;
}
/// <summary>
/// Redefine the equal operation between player.
/// </summary>
/// <param name="obj">The object to compare with the current player.</param>
/// <returns>true if the specified object is equal to the current player; otherwise, false.</returns>
public override bool Equals(object? obj)
{
if (obj == null || GetType() != obj.GetType())
/// <summary>
/// Chooses the operation for the player.
/// </summary>
/// <returns>The chosen operation.</returns>
public Operation ChooseOperation()
{
return false;
return Operation.LOWER;
}
Player c = (Player)obj;
return (Pseudo == c.Pseudo);
}
/// <summary>
/// Returns the hash code for the current player, in order for the Equals operation to work
/// </summary>
/// <returns>The hash code for the current player.</returns>
public override int GetHashCode()
{
return Pseudo.GetHashCode();
/// <summary>
/// Redefine the equal operation between player.
/// </summary>
/// <param name="obj">The object to compare with the current player.</param>
/// <returns>true if the specified object is equal to the current player; otherwise, false.</returns>
public override bool Equals(object? obj)
{
if (obj == null || GetType() != obj.GetType())
{
return false;
}
Player c = (Player)obj;
return (Pseudo == c.Pseudo);
}
/// <summary>
/// Returns the hash code for the current player, in order for the Equals operation to work
/// </summary>
/// <returns>The hash code for the current player.</returns>
public override int GetHashCode()
{
return Pseudo.GetHashCode();
}
}
}

@ -1,28 +1,30 @@
namespace Models.Game;
/// <summary>
/// The Position (x,y) of a cell in the game.
/// </summary>
public class Position
namespace Models.Game
{
/// <summary>
/// The X coordinate.
/// </summary>
public int X { get; set; }
/// <summary>
/// The Y coordinate.
/// </summary>
public int Y { get; set; }
/// <summary>
/// Constructor of the Position class.
/// The Position (x,y) of a cell in the game.
/// </summary>
/// <param name="x">The X coordinate.</param>
/// <param name="y">The Y coordinate.</param>
public Position(int x, int y)
public class Position
{
X = x;
Y = y;
/// <summary>
/// The X coordinate.
/// </summary>
public int X { get; set; }
/// <summary>
/// The Y coordinate.
/// </summary>
public int Y { get; set; }
/// <summary>
/// Constructor of the Position class.
/// </summary>
/// <param name="x">The X coordinate.</param>
/// <param name="y">The Y coordinate.</param>
public Position(int x, int y)
{
X = x;
Y = y;
}
}
}
}

@ -1,126 +1,128 @@
using Models.Game;
namespace Models.Interfaces;
/// <summary>
/// Interface for the rules of the game.
/// </summary>
public interface IRules
namespace Models.Interfaces
{
//public bool NearCellIsValid(Position playerChoicePosition, SortedDictionary<Position, Cell> cells);
/// <summary>
/// Return true if the cell is empty, otherwise false.
/// </summary>
/// <param name="playerChoice">The cell that the player chose</param>
/// <returns> Return true if the cell is empty, otherwise false.</returns>
public bool IsCellEmpty(Cell playerChoice);
/// <summary>
/// Check if the cell is valid.
/// </summary>
/// <param name="playerChoicePosition">The cell that the player chose</param>
/// <param name="cells">Boards of the actual game</param>
/// <returns>true if the cell is valid; otherwise, false</returns>
public bool IsCellValid(Cell playerChoicePosition, List<Cell> cells);
//public bool IsRopePath(Cell playerChoice, HashSet<RopePath> ropePaths);
//public bool IsAdjacent(Cell cell1, Cell cell2, List<Position, Cell> cells);
//public int HowMany(Cell playerChoice, List<Position, Cell> cells);
//public void SetValueAndPenalty(int valueChoice, Cell playerChoice, List<Position, Cell> cells);
/// <summary>
/// Check if the given cell is adjacent to the target cell.
/// </summary>
/// <param name="choosenCell">The chosen cell.</param>
/// <param name="targetCell">The target cell.</param>
/// <returns>True if the given cell is adjacent to the target cell; otherwise false.</returns>
public bool IsCellAdjacent(Cell choosenCell, Cell targetCell);
/// <summary>
/// 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.
/// </summary>
/// <param name="choosenCell">The chosen cell.</param>
/// <param name="cells">The list of cells.</param>
/// <returns>True if the chosen cell can be played here; otherwise false.</returns>
public bool NearCellIsValid(Cell choosenCell, List<Cell> cells);
/// <summary>
/// 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
/// </summary>
/// <param name="chosenCell">The chosen cell.</param>
/// <param name="map">The map.</param>
/// <returns></returns>
public void IsZoneValidAndAddToZones(Cell chosenCell, Map map);
/// <summary>
/// Check if the value of the chosen cell is in the zones of the player.
/// </summary>
/// <param name="chosenCell">The cell chosen by the player.</param>
/// <param name="zones">The list of the player's zones.</param>
/// <returns>True if the value is in the zones; otherwise false.</returns>
public bool IsValueInZones(Cell chosenCell, List<List<Cell>> zones);
/// <summary>
/// Check if the chosen cell is in any of the player's zones.
/// </summary>
/// <param name="chosenCell">The chosen cell.</param>
/// <param name="zones">The list of the player's zones.</param>
/// <returns>True if the cell is in any of the zones; otherwise false.</returns>
public bool IsCellInZone(Cell chosenCell, List<List<Cell>> zones);
/// <summary>
/// Add the chosen cell to the list of zones.
/// The zone must be created before.
/// </summary>
/// <param name="chosenCell">The chosen cell.</param>
/// <param name="zones">The list of zones.</param>
public void AddToZone(Cell chosenCell, List<List<Cell>> zones);
/// <summary>
/// Create a new zone with the two cells and add it to the map.
/// </summary>
/// <param name="firstCell">The first cell.</param>
/// <param name="secondCell">The second cell.</param>
/// <param name="map">The map.</param>
public void NewZoneIsCreated(Cell firstCell, Cell secondCell, Map map);
/// <summary>
/// Get every adjacent cell of the chosen cell.
/// </summary>
/// <param name="choosenCell">The chosen cell.</param>
/// <param name="cells">The list of cells.</param>
/// <returns>The list of adjacent cells.</returns>
public List<Cell> EveryAdjacentCells(Cell choosenCell, List<Cell> cells);
/// <summary>
/// Calculate the final score by summing up the values of all the zones.
/// </summary>
/// <param name="zones">The list of zones.</param>
/// <returns>The final score.</returns>
public int? FinalCalculusOfZones(List<List<Cell>> zones);
/// <summary>
/// Check if the adjacent cell is in any of the rope paths.
/// </summary>
/// <param name="adjacente">The adjacent cell.</param>
/// <param name="ropePaths">The list of rope paths.</param>
/// <param name="index">The index of the rope path.</param>
/// <returns>True if the adjacent cell is in the rope path; otherwise false.</returns>
public bool IsInRopePaths(Cell adjacente, List<List<Cell>> ropePaths, int index);
/// <summary>
/// Check if the chosen cell has the same value as the rope path at the given index.
/// Interface for the rules of the game.
/// </summary>
/// <param name="choosenCell">The chosen cell.</param>
/// <param name="ropePaths">The list of rope paths.</param>
/// <param name="index">The index of the rope path.</param>
/// <returns>True if the chosen cell has the same value as the rope path; otherwise false.</returns>
public bool AsValue(Cell choosenCell, List<List<Cell>> ropePaths, int index);
}
public interface IRules
{
//public bool NearCellIsValid(Position playerChoicePosition, SortedDictionary<Position, Cell> cells);
/// <summary>
/// Return true if the cell is empty, otherwise false.
/// </summary>
/// <param name="playerChoice">The cell that the player chose</param>
/// <returns> Return true if the cell is empty, otherwise false.</returns>
public bool IsCellEmpty(Cell playerChoice);
/// <summary>
/// Check if the cell is valid.
/// </summary>
/// <param name="playerChoicePosition">The cell that the player chose</param>
/// <param name="cells">Boards of the actual game</param>
/// <returns>true if the cell is valid; otherwise, false</returns>
public bool IsCellValid(Cell playerChoicePosition, List<Cell> cells);
//public bool IsRopePath(Cell playerChoice, HashSet<RopePath> ropePaths);
//public bool IsAdjacent(Cell cell1, Cell cell2, List<Position, Cell> cells);
//public int HowMany(Cell playerChoice, List<Position, Cell> cells);
//public void SetValueAndPenalty(int valueChoice, Cell playerChoice, List<Position, Cell> cells);
/// <summary>
/// Check if the given cell is adjacent to the target cell.
/// </summary>
/// <param name="choosenCell">The chosen cell.</param>
/// <param name="targetCell">The target cell.</param>
/// <returns>True if the given cell is adjacent to the target cell; otherwise false.</returns>
public bool IsCellAdjacent(Cell choosenCell, Cell targetCell);
/// <summary>
/// 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.
/// </summary>
/// <param name="choosenCell">The chosen cell.</param>
/// <param name="cells">The list of cells.</param>
/// <returns>True if the chosen cell can be played here; otherwise false.</returns>
public bool NearCellIsValid(Cell choosenCell, List<Cell> cells);
/// <summary>
/// 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
/// </summary>
/// <param name="chosenCell">The chosen cell.</param>
/// <param name="map">The map.</param>
/// <returns></returns>
public void IsZoneValidAndAddToZones(Cell chosenCell, Map map);
/// <summary>
/// Check if the value of the chosen cell is in the zones of the player.
/// </summary>
/// <param name="chosenCell">The cell chosen by the player.</param>
/// <param name="zones">The list of the player's zones.</param>
/// <returns>True if the value is in the zones; otherwise false.</returns>
public bool IsValueInZones(Cell chosenCell, List<List<Cell>> zones);
/// <summary>
/// Check if the chosen cell is in any of the player's zones.
/// </summary>
/// <param name="chosenCell">The chosen cell.</param>
/// <param name="zones">The list of the player's zones.</param>
/// <returns>True if the cell is in any of the zones; otherwise false.</returns>
public bool IsCellInZone(Cell chosenCell, List<List<Cell>> zones);
/// <summary>
/// Add the chosen cell to the list of zones.
/// The zone must be created before.
/// </summary>
/// <param name="chosenCell">The chosen cell.</param>
/// <param name="zones">The list of zones.</param>
public void AddToZone(Cell chosenCell, List<List<Cell>> zones);
/// <summary>
/// Create a new zone with the two cells and add it to the map.
/// </summary>
/// <param name="firstCell">The first cell.</param>
/// <param name="secondCell">The second cell.</param>
/// <param name="map">The map.</param>
public void NewZoneIsCreated(Cell firstCell, Cell secondCell, Map map);
/// <summary>
/// Get every adjacent cell of the chosen cell.
/// </summary>
/// <param name="choosenCell">The chosen cell.</param>
/// <param name="cells">The list of cells.</param>
/// <returns>The list of adjacent cells.</returns>
public List<Cell> EveryAdjacentCells(Cell choosenCell, List<Cell> cells);
/// <summary>
/// Calculate the final score by summing up the values of all the zones.
/// </summary>
/// <param name="zones">The list of zones.</param>
/// <returns>The final score.</returns>
public int? FinalCalculusOfZones(List<List<Cell>> zones);
/// <summary>
/// Check if the adjacent cell is in any of the rope paths.
/// </summary>
/// <param name="adjacente">The adjacent cell.</param>
/// <param name="ropePaths">The list of rope paths.</param>
/// <param name="index">The index of the rope path.</param>
/// <returns>True if the adjacent cell is in the rope path; otherwise false.</returns>
public bool IsInRopePaths(Cell adjacente, List<List<Cell>> ropePaths, int index);
/// <summary>
/// Check if the chosen cell has the same value as the rope path at the given index.
/// </summary>
/// <param name="choosenCell">The chosen cell.</param>
/// <param name="ropePaths">The list of rope paths.</param>
/// <param name="index">The index of the rope path.</param>
/// <returns>True if the chosen cell has the same value as the rope path; otherwise false.</returns>
public bool AsValue(Cell choosenCell, List<List<Cell>> ropePaths, int index);
}
}
Loading…
Cancel
Save