Game Logic in Frontend
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user