ajout du boardlayout et de la commande getmatch

This commit was merged in pull request #8.
This commit is contained in:
2025-03-26 22:21:07 +01:00
parent 7b00a91580
commit 899b1771d0
16 changed files with 374 additions and 25 deletions

View File

@@ -9,7 +9,7 @@ namespace Giants.Application;
/// </summary>
public class MatchRepositoryMock : IMatchRepository
{
private readonly IHexagonalGrid _gridLayout;
private readonly BoardLayout _boardLayout;
private static int _lastId = 1;
private Dictionary<int, Match> _matchs = new Dictionary<int, Match>();
@@ -17,9 +17,9 @@ public class MatchRepositoryMock : IMatchRepository
/// <summary>
/// constructeur
/// </summary>
public MatchRepositoryMock()
public MatchRepositoryMock(BoardLayout boardLayout)
{
_gridLayout = new HexagonalGridImpl();
_boardLayout = boardLayout;
}
/// <inheritdoc/>
@@ -35,9 +35,10 @@ public class MatchRepositoryMock : IMatchRepository
/// <inheritdoc/>
public Match CreateMatch()
{
Match result = new Match(_gridLayout)
Match result = new Match()
{
Id = _lastId++
Id = _lastId++,
Board = _boardLayout,
};
AddStaticData(result);
@@ -52,4 +53,8 @@ public class MatchRepositoryMock : IMatchRepository
}
public void SetMapData(IHexagonalGrid grid)
{
throw new NotImplementedException();
}
}