diff --git a/.drone.yml b/.drone.yml
index 22f1c76..bae151c 100644
--- a/.drone.yml
+++ b/.drone.yml
@@ -61,11 +61,11 @@ steps:
image: hub.codefirst.iut.uca.fr/maxime.batista/codefirst-docdeployer:latest
failure: ignore
commands:
- - /entrypoint.sh -l documentation/doxygen -t doxygen
+ - /entrypoint.sh -l doxygen -t doxygen
when:
branch:
- master
- dev
event:
- push
- depends_on: [ build-Models, tests ]
+ depends_on: [ tests ]
diff --git a/source/Trek-12/Models/Game/Game.cs b/source/Trek-12/Models/Game/Game.cs
index 82d1b0e..251a08a 100644
--- a/source/Trek-12/Models/Game/Game.cs
+++ b/source/Trek-12/Models/Game/Game.cs
@@ -9,6 +9,10 @@ using Models.Rules;
namespace Models.Game
{
+ ///
+ /// The Game class represents a game session in the application.
+ /// It contains all the necessary properties and methods to manage a game, including the game loop, dice rolling, and use of the game rules.
+ ///
public class Game
{
private bool _isRunning;
@@ -28,6 +32,11 @@ namespace Models.Game
public event EventHandler GameEnded;
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The player who play the game.
+ /// The map to be used in the game.
public Game(Player player, Map map)
{
_isRunning = false;
@@ -39,6 +48,9 @@ namespace Models.Game
GameRules = new Rules.Rules();
}
+ ///
+ /// Rolls all the dice.
+ ///
public void RollAllDice()
{
Dice1.Roll();
@@ -80,6 +92,12 @@ namespace Models.Game
}
}
+ ///
+ /// Places the result of a dice operation into a chosen cell on the game board.
+ /// The result can be placed in the chosen cell if it's the first turn or if the chosen cell is valid according to the game rules.
+ ///
+ /// The cell chosen by the player to place the result.
+ /// The result of the dice operation to be placed in the cell.
public void PlaceResult(Cell playerChoice, int result)
{
if (Turn == 1 || GameRules.NearCellIsValid(playerChoice, UsedMap.Boards))
@@ -92,9 +110,9 @@ namespace Models.Game
{
int index =0;
- foreach (var cells in adjacentes)
- {
- // La cellule choisi peut creer/s'ajouter a un chemin de corde
+ foreach (var cells in adjacentes)
+ {
+ // La cellule choisi peut creer/s'ajouter a un chemin de corde
if (cells.Value - playerChoice.Value == 1 || cells.Value - playerChoice.Value == -1)
{
// Le cas si il n'existe aucun chemin de corde
@@ -127,7 +145,7 @@ namespace Models.Game
// Ajouter au chemin
// {playerChoice.Value} existe dans le chemin de corde pas possible
- }
+ }
}
}
@@ -142,18 +160,21 @@ namespace Models.Game
GameLoop();
}
-
+ ///
+ /// The main game loop that runs while the game is active.
+ ///
private async void GameLoop()
{
while (_isRunning)
{
-
+ /*
if (CheckGameEnd()) //TODO Règle pour check si fin de jeu
{
_isRunning = false;
//TODO Code pour comptabiliser les points
- GameEnded?.Invoke(this, new GameEndedEventArgs(//player));
+ //GameEnded?.Invoke(this, new GameEndedEventArgs(player));
}
+ */
await Task.Delay(1000); // 1 seconde
}