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

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

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

@ -1,10 +1,10 @@
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 Cell class represents a cell in the application.
/// </summary>
public class Cell : Position, IEquatable<Cell>
{
/// <summary>
/// The value of the cell.
/// </summary>
@ -60,4 +60,5 @@ public class Cell : Position, IEquatable<Cell>
if (this.X == other.X && this.Y == other.Y) return true;
return false;
}
}
}

@ -1,10 +1,11 @@
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>
/// 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>
@ -73,4 +74,5 @@ public class Map
}
return operationGrid;
}
}
}

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

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

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

@ -1,12 +1,13 @@
using Models.Game;
namespace Models.Interfaces;
/// <summary>
/// Interface for the rules of the game.
/// </summary>
public interface IRules
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>
@ -123,4 +124,5 @@ public interface IRules
/// <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