Revert "Create db and db access. Add json converter for board array. Add tests for json conversion"
This reverts commit 7a532e52e1.
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
using JoshHeaps.Net.Services.Implementations;
|
||||
using JoshHeaps.Net.Utilities;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion.Internal;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace JoshHeaps.Net.Models;
|
||||
|
||||
@@ -12,7 +8,6 @@ public class GameState
|
||||
|
||||
// 8x8 board of references. Null if no piece is present.
|
||||
// row 0 at top -> row 7 at bottom (typical 0-based array).
|
||||
[JsonConverter(typeof(ChessBoardConverter))]
|
||||
public ChessPiece?[,] Board { get; set; }
|
||||
|
||||
// Whose turn is it?
|
||||
@@ -47,10 +42,7 @@ public class GameState
|
||||
public Guid BlackPlayerId { get; set; }
|
||||
|
||||
public bool IsVsComputer { get; set; } = false;
|
||||
public int ComputerDifficulty { get; set; } = 20;
|
||||
|
||||
[JsonIgnore] // <-- exclude from JSON
|
||||
[NotMapped] // <-- EF won't try to persist it either
|
||||
public Stockfish? Computer { get; set; }
|
||||
|
||||
// optional: convenience
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace JoshHeaps.Net.Models;
|
||||
|
||||
public class GameStateEntity
|
||||
{
|
||||
public Guid GameId { get; set; }
|
||||
public string SerializedState { get; set; } = ""; // JSON
|
||||
public DateTime LastMoveUtc { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user