Backend für "Slip It In" mit ASP.NET Core erstellt
- Neues Backend-Projekt mit Entity Framework Core (PostgreSQL) und geteilten Modellen/DTOs angelegt - Datenbankstruktur und Migrations implementiert (User, Game, Player, Phrase, PlayerCard, GameRound, SlipChallenge) - SignalR-Hub für Spielkommunikation (Lobby, Spielstart, Kartenvergabe, Slip/Challenge) hinzugefügt - Spiellogik und DB-Zugriffe im GameService gekapselt - JWT-Authentifizierung und CORS für Entwicklung konfiguriert - Projektdateien, NuGet-Abhängigkeiten und .gitignore aktualisiert - Startkonfiguration und Umgebungsdateien angepasst
This commit is contained in:
27
SlipItIn.Shared/Models/Game.cs
Normal file
27
SlipItIn.Shared/Models/Game.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace SlipItIn.Shared.Models;
|
||||
|
||||
public enum GameStatus
|
||||
{
|
||||
Lobby,
|
||||
InProgress,
|
||||
Completed,
|
||||
Cancelled
|
||||
}
|
||||
|
||||
public class Game
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string LobbyCode { get; set; } = string.Empty; // 4-6 stelliger Code
|
||||
public int HostId { get; set; }
|
||||
public GameStatus Status { get; set; } = GameStatus.Lobby;
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
public DateTime? StartedAt { get; set; }
|
||||
public DateTime? EndedAt { get; set; }
|
||||
public int MaxPlayers { get; set; } = 8;
|
||||
public int RoundDurationSeconds { get; set; } = 45;
|
||||
|
||||
// Navigation
|
||||
public User Host { get; set; } = null!;
|
||||
public ICollection<Player> Players { get; set; } = [];
|
||||
public ICollection<GameRound> Rounds { get; set; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user