Ajout de la documentation manquante et correction de namespaces invalides
continuous-integration/drone/push Build is failing Details

pull/67/head
Rémi LAVERGNE 11 months ago
parent 3b12f49976
commit 06a0badc99
No known key found for this signature in database
GPG Key ID: CA264B55E97FD220

@ -1,5 +1,9 @@
namespace Models.Events;
using Models.Game;
namespace Models.Events;
/// <summary>
/// Event arguments for when a cell is chosen.
/// </summary>
public class CellChosenEventArgs : EventArgs
{
public Cell Cell { get; }

@ -1,5 +1,9 @@
namespace Models.Events;
using Models.Game;
namespace Models.Events;
/// <summary>
/// Event arguments for when the dice are rolled.
/// </summary>
public class DiceRolledEventArgs : EventArgs
{
public int Dice1Value { get; }

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

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

@ -1,5 +1,9 @@
namespace Models.Events;
using Models.Game;
namespace Models.Events;
/// <summary>
/// Event arguments for when an operation is chosen.
/// </summary>
public class OperationChosenEventArgs : EventArgs
{
public Operation Operation { get; }

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

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

@ -5,8 +5,11 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models
namespace Models.Game
{
/// <summary>
/// This class represents the best score of a player.
/// </summary>
public class BestScore
{
/// <summary>

@ -1,5 +1,8 @@
namespace Models;
namespace Models.Game;
/// <summary>
/// The Cell class represents a cell in the application.
/// </summary>
public class Cell : Position, IEquatable<Cell>
{
/// <summary>

@ -6,6 +6,9 @@ using System.Threading.Tasks;
namespace Models.Game
{
/// <summary>
/// The Dice class represents a dice in the application.
/// </summary>
public class Dice
{
/// <summary>

@ -1,5 +1,8 @@
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>

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Models
namespace Models.Game
{
/// <summary>
/// Represents the available operations in the game.

@ -1,6 +1,8 @@
namespace Models;
namespace Models.Game;
/// <summary>
/// Represents a cell in the operation grid of the game.
/// </summary>
public class OperationCell : Position
{
/// <summary>

@ -1,5 +1,8 @@
namespace Models.Game;
/// <summary>
/// Represents a player in the game.
/// </summary>
public class Player
{
/// <summary>

@ -1,5 +1,8 @@
namespace Models;
namespace Models.Game;
/// <summary>
/// The Position (x,y) of a cell in the game.
/// </summary>
public class Position
{
/// <summary>

@ -2,6 +2,9 @@
namespace Models.Interfaces;
/// <summary>
/// Interface for the rules of the game.
/// </summary>
public interface IRules
{
//public bool NearCellIsValid(Position playerChoicePosition, SortedDictionary<Position, Cell> cells);

@ -7,7 +7,10 @@ using Models.Game;
using Models.Interfaces;
namespace Models.Rules
{
{
/// <summary>
/// The Rules class contains all the rules of the game. It is used to check if a move is valid or not.
/// </summary>
public class Rules : IRules
{
@ -47,23 +50,23 @@ namespace Models.Rules
}
public bool IsInRopePaths (Cell adjacente,List<List<Cell>> ropePaths,int index)
{
foreach (List<Cell> path in ropePaths)
{
{
foreach (List<Cell> path in ropePaths)
{
if (path.Contains(adjacente))
{
index=ropePaths.IndexOf(path);
return true;
}
}
}
return false;
}
public bool AsValue (Cell choosenCell, List<List<Cell>> ropePaths,int index)
{
foreach (var item in ropePaths[index])
{
if (choosenCell.Value == item.Value) return true;
foreach (var item in ropePaths[index])
{
if (choosenCell.Value == item.Value) return true;
}
return false;
}

Loading…
Cancel
Save