85521f3b23
Change GameManager/CreateGame to return (gameId, gameCode) and Make JoinGame return the game Id (or null) instead of a bool. Update IGameManager signature accordingly. Refactor Hub methods to construct Player objects, accept Coordinates for game creation, use the manager results to add connections to groups and send GameCreated with GameId and GameCode, and handle join failures with an error message. Simplify Player class to use a primary-constructor style with property initialization; add necessary using directives.
9 lines
228 B
C#
9 lines
228 B
C#
using API.Models.Game;
|
|
|
|
namespace API.Services.GameManager;
|
|
|
|
public interface IGameManager
|
|
{
|
|
public (string, int) CreateGame(Coordinates gFs, Player player);
|
|
public string? JoinGame(Player playerName, int gameCode);
|
|
} |