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

14 lines
388 B
C#

using API.Models.DataClasses;
using API.Models.Game;
namespace API.Repository.GameRepo;
public interface IGameRepository
{
public List<Game> GetAll();
public Game? GetOne(string id);
public Game? GetOne(SixDigitInt gameCode);
public Game? GetOneByConnectionId(string connectionId);
public Game Create(Coordinates gameFieldSize);
public void Destroy(string id);
}