Refactor GameRepository and GameManager architecture, introduce Player model, and update dependency registration in Program.cs.
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
namespace API.Services.GameManager;
|
||||
using API.Models.Game;
|
||||
using API.Repository.GameRepo;
|
||||
|
||||
public class GameManager : IGameManager
|
||||
namespace API.Services.GameManager;
|
||||
|
||||
public class GameManager(IGameRepository gameRepository) : IGameManager
|
||||
{
|
||||
public int CreateGame(string playerName)
|
||||
private readonly IGameRepository _gameRepo = gameRepository;
|
||||
|
||||
public int CreateGame(Coordinates gFs, Player player)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool JoinGame(string playerName, int gameCode)
|
||||
public bool JoinGame(Player playerName, int gameCode)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
private int GenerateNonExistingGameCode()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
namespace API.Services.GameManager;
|
||||
using API.Models.Game;
|
||||
|
||||
namespace API.Services.GameManager;
|
||||
|
||||
public interface IGameManager
|
||||
{
|
||||
public int CreateGame(string playerName);
|
||||
public bool JoinGame(string playerName, int gameCode);
|
||||
public int CreateGame(Coordinates gFs, Player player);
|
||||
public bool JoinGame(Player playerName, int gameCode);
|
||||
}
|
||||
Reference in New Issue
Block a user