Game Logic in Frontend

This commit is contained in:
jhim
2026-03-07 14:05:28 +01:00
committed by Jonas
parent 34f683854b
commit 919bb71f19
8 changed files with 148 additions and 54 deletions
-10
View File
@@ -4,17 +4,7 @@ namespace API.Models.Game;
public readonly struct Coordinates
{
[JsonConstructor]
public Coordinates(int x, int y)
{
X = x;
Y = y;
}
[JsonPropertyName("x")]
public int X { get; init; }
[JsonPropertyName("y")]
public int Y { get; init; }
}
+2
View File
@@ -69,6 +69,8 @@ public class GameManager(IGameRepository gameRepository, IHubContext<GameHubSock
if(game.CurrentTurn != player.PlayerTag)
return;
if(game.State != GameState.Running) return;
var result = game.Field.Drop(column, player.PlayerTag);
if (result != DropResult.Placed)