before deleting Rules

This commit is contained in:
2021-05-08 10:26:04 -05:00
parent 05a9c71499
commit f8f779e84c
80 changed files with 1109 additions and 832 deletions

View File

@@ -1,11 +1,12 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types
{
public class BoardState
{
public Piece[,] Board { get; set; }
public IReadOnlyCollection<Piece> Player1Hand { get; set; }
public IReadOnlyCollection<Piece> Player2Hand { get; set; }
public Piece[,] Board { get; set; } = new Piece[0, 0];
public IReadOnlyCollection<Piece> Player1Hand { get; set; } = Array.Empty<Piece>();
public IReadOnlyCollection<Piece> Player2Hand { get; set; } = Array.Empty<Piece>();
}
}

View File

@@ -7,7 +7,6 @@
JoinGame,
JoinByCode,
LoadGame,
Move,
KeepAlive
Move
}
}

View File

@@ -1,13 +1,14 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types
{
public class Game
{
public string GameName { get; set; }
public string GameName { get; set; } = string.Empty;
/// <summary>
/// Players[0] is the session owner, Players[1] is the other guy
/// </summary>
public IReadOnlyList<string> Players { get; set; }
public IReadOnlyList<string> Players { get; set; } = Array.Empty<string>();
}
}

View File

@@ -2,11 +2,11 @@
{
public class Move
{
public string PieceFromCaptured { get; set; }
public WhichPiece? PieceFromCaptured { get; set; }
/// <summary>Board position notation, like A3 or G1</summary>
public string From { get; set; }
public string? From { get; set; }
/// <summary>Board position notation, like A3 or G1</summary>
public string To { get; set; }
public string To { get; set; } = string.Empty;
public bool IsPromotion { get; set; }
}
}

View File

@@ -2,8 +2,8 @@
{
public class Piece
{
public WhichPiece WhichPiece { get; set; }
public bool IsPromoted { get; set; }
public WhichPiece WhichPiece { get; set; }
public WhichPlayer Owner { get; set; }
}
}

View File

@@ -0,0 +1,8 @@
namespace Gameboard.ShogiUI.Sockets.ServiceModels.Socket.Types
{
public enum WhichPlayer
{
Player1,
Player2
}
}