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

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

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

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

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

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

@ -1,76 +1,78 @@
namespace Models.Game; 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
{ {
/// <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> /// <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> /// </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> /// <summary>
/// It is a list of a list containing user's rope paths in the current game /// It is the grid of the possible operation in the game
/// </summary> /// </summary>
public List<List<Cell>> RopePaths { get; private set; } public List<OperationCell> OperationGrid { get; private set; }
/// <summary> /// <summary>
/// It is a list of a list containing user's zones in the current game /// It is a list of a list containing user's rope paths in the current game
/// </summary> /// </summary>
public List<List<Cell>> Zones { get; private set; } public List<List<Cell>> RopePaths { get; private set; }
/// <summary> /// <summary>
/// Initializes a new instance of the Map class. /// It is a list of a list containing user's zones in the current game
/// </summary> /// </summary>
/// <param name="background">The background of the map.</param> public List<List<Cell>> Zones { get; private set; }
public Map(string background)
{
Boards = InitializeBoards();
Background = background;
OperationGrid = InitializeOperationGrid();
RopePaths = new List<List<Cell>>();
Zones = new List<List<Cell>>();
}
/// <summary> /// <summary>
/// Initializes the boards of the map. /// Initializes a new instance of the Map class.
/// </summary> /// </summary>
/// <returns>Return the boards</returns> /// <param name="background">The background of the map.</param>
private List<Cell> InitializeBoards() public Map(string background)
{
var boards = new List<Cell>();
for (int i = 0; i < 36; i++) // 6x6 board
{ {
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 boards of the map.
/// <summary> /// </summary>
/// Initializes the operation grid of the map. /// <returns>Return the boards</returns>
/// </summary> private List<Cell> InitializeBoards()
/// <returns>Return the operation grid</returns> {
private List<OperationCell> InitializeOperationGrid() var boards = new List<Cell>();
{ for (int i = 0; i < 36; i++) // 6x6 board
var operationGrid = new List<OperationCell>(); {
for (int i = 0; i < 5; i++) // 5 operations 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; namespace Models.Game
/// <summary>
/// Represents a cell in the operation grid of the game.
/// </summary>
public class OperationCell : Position
{ {
/// <summary> /// <summary>
/// It tells if the operation is checked or not in the operation grid of the game. /// Represents a cell in the operation grid of the game.
/// </summary>
public bool IsChecked { get; private set; }
/// <summary>
/// Constructor of the OperationCell class.
/// </summary> /// </summary>
/// <param name="x"></param> public class OperationCell : Position
/// <param name="y"></param>
public OperationCell (int x,int y) :base (x,y)
{ }
/// <summary>
/// Check the operation cell.
/// </summary>
public void Check()
{ {
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; namespace Models.Game
/// <summary>
/// Represents a player in the game.
/// </summary>
public class Player
{ {
/// <summary>
/// It is he pseudo of the player.
/// </summary>
public string Pseudo { get; private set; }
/// <summary> /// <summary>
/// It is the profile picture of the player. /// Represents a player in the game.
/// </summary> /// </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> /// <summary>
/// It is the creation date of the player. /// It is the profile picture of the player.
/// </summary> /// </summary>
public string? CreationDate { get; private set; } public string ProfilePicture { get; private set; }
/// <summary> /// <summary>
/// It tells when was the last time the player played. /// It is the creation date of the player.
/// </summary> /// </summary>
public string? LastPlayed { get; private set; } public string? CreationDate { get; private set; }
/// <summary> /// <summary>
/// Constructor with default values. /// It tells when was the last time the player played.
/// </summary> /// </summary>
public Player() public string? LastPlayed { get; private set; }
{
Pseudo = "Player";
ProfilePicture = "DefaultProfilePicture";
}
/// <summary> /// <summary>
/// Construct a new instance of Player with specified pseudo and profile picture. /// Constructor with default values.
/// </summary> /// </summary>
/// <param name="pseudo">The pseudo of the player.</param> public Player()
/// <param name="profilePicture">The profile picture of the player.</param> {
public Player(string pseudo, string profilePicture = "DefaultProfilePicture") Pseudo = "Player";
{ ProfilePicture = "DefaultProfilePicture";
Pseudo = pseudo; }
ProfilePicture = profilePicture;
}
/// <summary> /// <summary>
/// Chooses the operation for the player. /// Construct a new instance of Player with specified pseudo and profile picture.
/// </summary> /// </summary>
/// <returns>The chosen operation.</returns> /// <param name="pseudo">The pseudo of the player.</param>
public Operation ChooseOperation() /// <param name="profilePicture">The profile picture of the player.</param>
{ public Player(string pseudo, string profilePicture = "DefaultProfilePicture")
return Operation.LOWER; {
} Pseudo = pseudo;
ProfilePicture = profilePicture;
}
/// <summary> /// <summary>
/// Redefine the equal operation between player. /// Chooses the operation for the player.
/// </summary> /// </summary>
/// <param name="obj">The object to compare with the current player.</param> /// <returns>The chosen operation.</returns>
/// <returns>true if the specified object is equal to the current player; otherwise, false.</returns> public Operation ChooseOperation()
public override bool Equals(object? obj)
{
if (obj == null || GetType() != obj.GetType())
{ {
return false; return Operation.LOWER;
} }
Player c = (Player)obj;
return (Pseudo == c.Pseudo);
}
/// <summary> /// <summary>
/// Returns the hash code for the current player, in order for the Equals operation to work /// Redefine the equal operation between player.
/// </summary> /// </summary>
/// <returns>The hash code for the current player.</returns> /// <param name="obj">The object to compare with the current player.</param>
public override int GetHashCode() /// <returns>true if the specified object is equal to the current player; otherwise, false.</returns>
{ public override bool Equals(object? obj)
return Pseudo.GetHashCode(); {
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; namespace Models.Game
/// <summary>
/// The Position (x,y) of a cell in the game.
/// </summary>
public class Position
{ {
/// <summary>
/// The X coordinate.
/// </summary>
public int X { get; set; }
/// <summary>
/// The Y coordinate.
/// </summary>
public int Y { get; set; }
/// <summary> /// <summary>
/// Constructor of the Position class. /// The Position (x,y) of a cell in the game.
/// </summary> /// </summary>
/// <param name="x">The X coordinate.</param> public class Position
/// <param name="y">The Y coordinate.</param>
public Position(int x, int y)
{ {
X = x; /// <summary>
Y = y; /// 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; using Models.Game;
namespace Models.Interfaces; namespace Models.Interfaces
/// <summary>
/// Interface for the rules of the game.
/// </summary>
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> /// <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> /// </summary>
/// <param name="choosenCell">The chosen cell.</param> public interface IRules
/// <param name="ropePaths">The list of rope paths.</param> {
/// <param name="index">The index of the rope path.</param> //public bool NearCellIsValid(Position playerChoicePosition, SortedDictionary<Position, Cell> cells);
/// <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); /// <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