using Models.Game;
namespace Models.Interfaces
{
///
/// Interface for the rules of the game.
///
public interface IRules
{
///
/// 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);
///
/// 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);
}
} | | | |