ajout de la commande de creation de match
This commit was merged in pull request #7.
This commit is contained in:
@@ -10,6 +10,9 @@ namespace Giants.Application;
|
||||
public class MatchRepositoryMock : IMatchRepository
|
||||
{
|
||||
private readonly IHexagonalGrid _gridLayout;
|
||||
private static int _lastId = 1;
|
||||
|
||||
private Dictionary<int, Match> _matchs = new Dictionary<int, Match>();
|
||||
|
||||
/// <summary>
|
||||
/// constructeur
|
||||
@@ -22,10 +25,31 @@ public class MatchRepositoryMock : IMatchRepository
|
||||
/// <inheritdoc/>
|
||||
public Match? GetMatch(int matchId)
|
||||
{
|
||||
Match result = new Match(_gridLayout);
|
||||
if (_matchs.TryGetValue(matchId, out Match? found))
|
||||
{
|
||||
return found;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Match CreateMatch()
|
||||
{
|
||||
Match result = new Match(_gridLayout)
|
||||
{
|
||||
Id = _lastId++
|
||||
};
|
||||
|
||||
AddStaticData(result);
|
||||
|
||||
_matchs.Add(result.Id, result);
|
||||
|
||||
// Ajout des données statiques
|
||||
return result;
|
||||
}
|
||||
|
||||
private void AddStaticData(Match match)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user