diff --git a/source/Trek-12/Models/Events/CellChosenEventArgs.cs b/source/Trek-12/Models/Events/CellChosenEventArgs.cs
index 2367a26..24f0a35 100644
--- a/source/Trek-12/Models/Events/CellChosenEventArgs.cs
+++ b/source/Trek-12/Models/Events/CellChosenEventArgs.cs
@@ -1,5 +1,9 @@
-namespace Models.Events;
+using Models.Game;
+namespace Models.Events;
+///
+/// Event arguments for when a cell is chosen.
+///
public class CellChosenEventArgs : EventArgs
{
public Cell Cell { get; }
diff --git a/source/Trek-12/Models/Events/DiceRolledEventArgs.cs b/source/Trek-12/Models/Events/DiceRolledEventArgs.cs
index a800a95..a1b6da1 100644
--- a/source/Trek-12/Models/Events/DiceRolledEventArgs.cs
+++ b/source/Trek-12/Models/Events/DiceRolledEventArgs.cs
@@ -1,5 +1,9 @@
-namespace Models.Events;
+using Models.Game;
+namespace Models.Events;
+///
+/// Event arguments for when the dice are rolled.
+///
public class DiceRolledEventArgs : EventArgs
{
public int Dice1Value { get; }
diff --git a/source/Trek-12/Models/Events/GameEndedEventArgs.cs b/source/Trek-12/Models/Events/GameEndedEventArgs.cs
index 5c53a2e..31319f1 100644
--- a/source/Trek-12/Models/Events/GameEndedEventArgs.cs
+++ b/source/Trek-12/Models/Events/GameEndedEventArgs.cs
@@ -1,6 +1,9 @@
using Models.Game;
namespace Models.Events;
+///
+/// Event arguments for when the game ends.
+///
public class GameEndedEventArgs : EventArgs
{
public Player CurrentPlayer { get; }
diff --git a/source/Trek-12/Models/Events/GameStartedEventArgs.cs b/source/Trek-12/Models/Events/GameStartedEventArgs.cs
index a35389d..f2bfeac 100644
--- a/source/Trek-12/Models/Events/GameStartedEventArgs.cs
+++ b/source/Trek-12/Models/Events/GameStartedEventArgs.cs
@@ -1,6 +1,9 @@
using Models.Game;
namespace Models.Events;
+///
+/// Event arguments for when the game starts.
+///
public class GameStartedEventArgs : EventArgs
{
public Player CurrentPlayer { get; }
diff --git a/source/Trek-12/Models/Events/OperationChosenEventArgs.cs b/source/Trek-12/Models/Events/OperationChosenEventArgs.cs
index 04a1f14..a200bf7 100644
--- a/source/Trek-12/Models/Events/OperationChosenEventArgs.cs
+++ b/source/Trek-12/Models/Events/OperationChosenEventArgs.cs
@@ -1,5 +1,9 @@
-namespace Models.Events;
+using Models.Game;
+namespace Models.Events;
+///
+/// Event arguments for when an operation is chosen.
+///
public class OperationChosenEventArgs : EventArgs
{
public Operation Operation { get; }
diff --git a/source/Trek-12/Models/Exceptions/InvalidCellCoordinatesException.cs b/source/Trek-12/Models/Exceptions/InvalidCellCoordinatesException.cs
index d310326..998794a 100644
--- a/source/Trek-12/Models/Exceptions/InvalidCellCoordinatesException.cs
+++ b/source/Trek-12/Models/Exceptions/InvalidCellCoordinatesException.cs
@@ -1,5 +1,8 @@
namespace Models.Exceptions;
+///
+/// Exception for when the cell coordinates are invalid.
+///
public class InvalidCellCoordinatesException : Exception
{
public InvalidCellCoordinatesException(string message) : base(message) { }
diff --git a/source/Trek-12/Models/Exceptions/InvalidCellException.cs b/source/Trek-12/Models/Exceptions/InvalidCellException.cs
index 5a7e4fd..2c46533 100644
--- a/source/Trek-12/Models/Exceptions/InvalidCellException.cs
+++ b/source/Trek-12/Models/Exceptions/InvalidCellException.cs
@@ -1,5 +1,8 @@
namespace Models.Exceptions;
+///
+/// Exception for when the cell is invalid.
+///
public class InvalidCellException : Exception
{
public InvalidCellException(string message) : base(message) { }
diff --git a/source/Trek-12/Models/Game/BestScore.cs b/source/Trek-12/Models/Game/BestScore.cs
index e54d58c..c2c5ca4 100644
--- a/source/Trek-12/Models/Game/BestScore.cs
+++ b/source/Trek-12/Models/Game/BestScore.cs
@@ -5,8 +5,11 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace Models
+namespace Models.Game
{
+ ///
+ /// This class represents the best score of a player.
+ ///
public class BestScore
{
///
diff --git a/source/Trek-12/Models/Game/Cell.cs b/source/Trek-12/Models/Game/Cell.cs
index c0bb1c5..b28299f 100644
--- a/source/Trek-12/Models/Game/Cell.cs
+++ b/source/Trek-12/Models/Game/Cell.cs
@@ -1,5 +1,8 @@
-namespace Models;
+namespace Models.Game;
+///
+/// The Cell class represents a cell in the application.
+///
public class Cell : Position, IEquatable
{
///
diff --git a/source/Trek-12/Models/Game/Dice.cs b/source/Trek-12/Models/Game/Dice.cs
index 62e2038..2d47fe3 100644
--- a/source/Trek-12/Models/Game/Dice.cs
+++ b/source/Trek-12/Models/Game/Dice.cs
@@ -6,6 +6,9 @@ using System.Threading.Tasks;
namespace Models.Game
{
+ ///
+ /// The Dice class represents a dice in the application.
+ ///
public class Dice
{
///
diff --git a/source/Trek-12/Models/Game/Map.cs b/source/Trek-12/Models/Game/Map.cs
index c599ddc..04f727f 100644
--- a/source/Trek-12/Models/Game/Map.cs
+++ b/source/Trek-12/Models/Game/Map.cs
@@ -1,5 +1,8 @@
namespace Models.Game;
+///
+/// The Map class is the representation of the game map with the board and the operations table.
+///
public class Map
{
///
diff --git a/source/Trek-12/Models/Game/Operation.cs b/source/Trek-12/Models/Game/Operation.cs
index 1a9f9c4..2eca1fe 100644
--- a/source/Trek-12/Models/Game/Operation.cs
+++ b/source/Trek-12/Models/Game/Operation.cs
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace Models
+namespace Models.Game
{
///
/// Represents the available operations in the game.
diff --git a/source/Trek-12/Models/Game/OperationCell.cs b/source/Trek-12/Models/Game/OperationCell.cs
index 550beae..baffc98 100644
--- a/source/Trek-12/Models/Game/OperationCell.cs
+++ b/source/Trek-12/Models/Game/OperationCell.cs
@@ -1,6 +1,8 @@
-namespace Models;
-
+namespace Models.Game;
+///
+/// Represents a cell in the operation grid of the game.
+///
public class OperationCell : Position
{
///
diff --git a/source/Trek-12/Models/Game/Player.cs b/source/Trek-12/Models/Game/Player.cs
index cf6ffb7..d9c9d13 100644
--- a/source/Trek-12/Models/Game/Player.cs
+++ b/source/Trek-12/Models/Game/Player.cs
@@ -1,5 +1,8 @@
namespace Models.Game;
+///
+/// Represents a player in the game.
+///
public class Player
{
///
diff --git a/source/Trek-12/Models/Game/Position.cs b/source/Trek-12/Models/Game/Position.cs
index 40c23d6..05193fa 100644
--- a/source/Trek-12/Models/Game/Position.cs
+++ b/source/Trek-12/Models/Game/Position.cs
@@ -1,5 +1,8 @@
-namespace Models;
+namespace Models.Game;
+///
+/// The Position (x,y) of a cell in the game.
+///
public class Position
{
///
diff --git a/source/Trek-12/Models/Interfaces/IRules.cs b/source/Trek-12/Models/Interfaces/IRules.cs
index 714a44c..7a9cffe 100644
--- a/source/Trek-12/Models/Interfaces/IRules.cs
+++ b/source/Trek-12/Models/Interfaces/IRules.cs
@@ -2,6 +2,9 @@
namespace Models.Interfaces;
+///
+/// Interface for the rules of the game.
+///
public interface IRules
{
//public bool NearCellIsValid(Position playerChoicePosition, SortedDictionary cells);
diff --git a/source/Trek-12/Models/Rules/Rules.cs b/source/Trek-12/Models/Rules/Rules.cs
index 25f0d64..8a7dc43 100644
--- a/source/Trek-12/Models/Rules/Rules.cs
+++ b/source/Trek-12/Models/Rules/Rules.cs
@@ -7,7 +7,10 @@ using Models.Game;
using Models.Interfaces;
namespace Models.Rules
-{
+{
+ ///
+ /// The Rules class contains all the rules of the game. It is used to check if a move is valid or not.
+ ///
public class Rules : IRules
{
@@ -47,23 +50,23 @@ namespace Models.Rules
}
public bool IsInRopePaths (Cell adjacente,List> ropePaths,int index)
- {
- foreach (List path in ropePaths)
- {
+ {
+ foreach (List path in ropePaths)
+ {
if (path.Contains(adjacente))
{
index=ropePaths.IndexOf(path);
return true;
- }
+ }
}
return false;
}
public bool AsValue (Cell choosenCell, List> 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;
}
| | |