Files
Jonas e8b45fa235 Add column drop, game info DTO, and disconnect
Introduce column-based drop mechanics and game info transfer; add disconnect handling and related API/interface updates. GameField API renamed Place->Drop and PlaceResult->DropResult, added ColumnFull, IsFull, and updated drop logic to insert at lowest empty row. Game model now exposes Players, adds GetPlayerByTag and makes StartGame public. New GameInformationDto conveys game state and field. Hub methods updated: GameCreated->GameJoined, RequestGameInformation, Place now forwards to Drop, and OnDisconnectedAsync notifies GameManager. GameManager implements RequestGameInformation, Drop (validates moves, broadcasts FieldUpdated and GameEnded on win/draw), improved JoinGame logic to auto-start when two players join, and handles player disconnects. Repository and interface extended with GetOneByConnectionId. Also tightened SignalR timeouts in Program.
2026-03-12 23:20:05 +01:00

13 lines
459 B
C#

using API.Models.Game;
namespace API.Services.GameManager;
public interface IGameManager
{
public (string, int) CreateGame(Coordinates gFs, Player player);
public Task<string?> JoinGame(Player player, int gameCode);
public Task RequestGameInformation(string gameId, string playerConnectionId);
public Task Drop(string gameCode, int coordinates, string playerConnectionId);
public Task DisconnectedPlayer(string playerConnectionId);
}