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 1 year ago
parent cb5edd97af
commit 1714634f47
No known key found for this signature in database
GPG Key ID: CA264B55E97FD220

@ -1,11 +1,12 @@
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
{ {
/// <summary>
/// Event arguments for when a cell is chosen.
/// </summary>
public class CellChosenEventArgs : EventArgs
{
public Cell Cell { get; } public Cell Cell { get; }
public int Result { get; } public int Result { get; }
@ -14,4 +15,5 @@ public class CellChosenEventArgs : EventArgs
Cell = cell; Cell = cell;
Result = result; Result = result;
} }
}
} }

@ -1,11 +1,12 @@
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
{ {
/// <summary>
/// Event arguments for when the dice are rolled.
/// </summary>
public class DiceRolledEventArgs : EventArgs
{
public int Dice1Value { get; } public int Dice1Value { get; }
public int Dice2Value { get; } public int Dice2Value { get; }
@ -14,4 +15,5 @@ public class DiceRolledEventArgs : EventArgs
Dice1Value = dice1Value; Dice1Value = dice1Value;
Dice2Value = dice2Value; 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
{ {
/// <summary>
/// Event arguments for when the game ends.
/// </summary>
public class GameEndedEventArgs : EventArgs
{
public Player CurrentPlayer { get; } public Player CurrentPlayer { get; }
public GameEndedEventArgs(Player winner) public GameEndedEventArgs(Player winner)
{ {
CurrentPlayer = 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
{ {
/// <summary>
/// Event arguments for when the game starts.
/// </summary>
public class GameStartedEventArgs : EventArgs
{
public Player CurrentPlayer { get; } public Player CurrentPlayer { get; }
public GameStartedEventArgs(Player selectedPlayer) public GameStartedEventArgs(Player selectedPlayer)
{ {
CurrentPlayer = selectedPlayer; CurrentPlayer = selectedPlayer;
} }
}
} }

@ -1,11 +1,12 @@
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
{ {
/// <summary>
/// Event arguments for when an operation is chosen.
/// </summary>
public class OperationChosenEventArgs : EventArgs
{
public Operation Operation { get; } public Operation Operation { get; }
public int Result { get; } public int Result { get; }
@ -14,4 +15,5 @@ public class OperationChosenEventArgs : EventArgs
Operation = operation; Operation = operation;
Result = result; 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
{ {
/// <summary>
/// Exception for when the cell coordinates are invalid.
/// </summary>
public class InvalidCellCoordinatesException : Exception
{
public InvalidCellCoordinatesException(string message) : base(message) { } 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
{ {
/// <summary>
/// Exception for when the cell is invalid.
/// </summary>
public class InvalidCellException : Exception
{
public InvalidCellException(string message) : base(message) { } public InvalidCellException(string message) : base(message) { }
}
} }

@ -1,10 +1,10 @@
namespace Models.Game; namespace Models.Game
/// <summary>
/// The Cell class represents a cell in the application.
/// </summary>
public class Cell : Position, IEquatable<Cell>
{ {
/// <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 value of the cell.
/// </summary> /// </summary>
@ -60,4 +60,5 @@ public class Cell : Position, IEquatable<Cell>
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,10 +1,11 @@
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>
/// The Map class is the representation of the game map with the board and the operations table.
/// </summary>
public class Map
{
/// <summary> /// <summary>
/// It is the list of cells on the map. /// It is the list of cells on the map.
/// </summary> /// </summary>
@ -73,4 +74,5 @@ public class Map
} }
return operationGrid; return operationGrid;
} }
}
} }

@ -1,10 +1,10 @@
namespace Models.Game; namespace Models.Game
/// <summary>
/// Represents a cell in the operation grid of the game.
/// </summary>
public class OperationCell : Position
{ {
/// <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. /// It tells if the operation is checked or not in the operation grid of the game.
/// </summary> /// </summary>
@ -15,8 +15,9 @@ public class OperationCell : Position
/// </summary> /// </summary>
/// <param name="x"></param> /// <param name="x"></param>
/// <param name="y"></param> /// <param name="y"></param>
public OperationCell (int x,int y) :base (x,y) public OperationCell(int x, int y) : base(x, y)
{ } {
}
/// <summary> /// <summary>
/// Check the operation cell. /// Check the operation cell.
@ -25,4 +26,5 @@ public class OperationCell : Position
{ {
IsChecked = true; IsChecked = true;
} }
}
} }

@ -1,10 +1,11 @@
namespace Models.Game; namespace Models.Game
/// <summary>
/// Represents a player in the game.
/// </summary>
public class Player
{ {
/// <summary>
/// Represents a player in the game.
/// </summary>
public class Player
{
/// <summary> /// <summary>
/// It is he pseudo of the player. /// It is he pseudo of the player.
/// </summary> /// </summary>
@ -77,4 +78,5 @@ public class Player
{ {
return Pseudo.GetHashCode(); return Pseudo.GetHashCode();
} }
}
} }

@ -1,10 +1,11 @@
namespace Models.Game; namespace Models.Game
/// <summary>
/// The Position (x,y) of a cell in the game.
/// </summary>
public class Position
{ {
/// <summary>
/// The Position (x,y) of a cell in the game.
/// </summary>
public class Position
{
/// <summary> /// <summary>
/// The X coordinate. /// The X coordinate.
/// </summary> /// </summary>
@ -25,4 +26,5 @@ public class Position
X = x; X = x;
Y = y; Y = y;
} }
}
} }

@ -1,12 +1,13 @@
using Models.Game; using Models.Game;
namespace Models.Interfaces; namespace Models.Interfaces
/// <summary>
/// Interface for the rules of the game.
/// </summary>
public interface IRules
{ {
/// <summary>
/// Interface for the rules of the game.
/// </summary>
public interface IRules
{
//public bool NearCellIsValid(Position playerChoicePosition, SortedDictionary<Position, Cell> cells); //public bool NearCellIsValid(Position playerChoicePosition, SortedDictionary<Position, Cell> cells);
/// <summary> /// <summary>
@ -123,4 +124,5 @@ public interface IRules
/// <param name="index">The index of the rope path.</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> /// <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 bool AsValue(Cell choosenCell, List<List<Cell>> ropePaths, int index);
}
} }
Loading…
Cancel
Save