squash a bunch of commits

This commit is contained in:
2022-10-30 12:03:16 -05:00
parent 09b72c1858
commit 93027e8c57
222 changed files with 6157 additions and 3201 deletions

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
namespace Shogi.Contracts.Types
{
public class BoardState
{
public Dictionary<string, Piece?> Board { get; set; } = new Dictionary<string, Piece?>();
public IReadOnlyCollection<Piece> Player1Hand { get; set; } = Array.Empty<Piece>();
public IReadOnlyCollection<Piece> Player2Hand { get; set; } = Array.Empty<Piece>();
public WhichPlayer? PlayerInCheck { get; set; }
public WhichPlayer WhoseTurn { get; set; }
}
}

View File

@@ -0,0 +1,12 @@
namespace Shogi.Contracts.Types
{
public class Move
{
public WhichPiece? PieceFromCaptured { get; set; }
/// <summary>Board position notation, like A3 or G1</summary>
public string? From { get; set; }
/// <summary>Board position notation, like A3 or G1</summary>
public string To { get; set; } = string.Empty;
public bool IsPromotion { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace Shogi.Contracts.Types
{
public class Piece
{
public bool IsPromoted { get; set; }
public WhichPiece WhichPiece { get; set; }
public WhichPlayer Owner { get; set; }
}
}

View File

@@ -0,0 +1,10 @@
namespace Shogi.Contracts.Types
{
public class Session
{
public string Player1 { get; set; }
public string? Player2 { get; set; }
public string SessionName { get; set; }
public BoardState BoardState { get; set; }
}
}

View File

@@ -0,0 +1,8 @@
namespace Shogi.Contracts.Types
{
public class SessionMetadata
{
public string Name { get; set; }
public int PlayerCount { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace Shogi.Contracts.Types
{
public enum SocketAction
{
SessionCreated,
SessionJoined,
PieceMoved
}
}

View File

@@ -0,0 +1,9 @@
namespace Shogi.Contracts.Types
{
public class User
{
public string Id { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,8 @@
namespace Shogi.Contracts.Types
{
public enum WhichPlayer
{
Player1,
Player2
}
}

View File

@@ -0,0 +1,14 @@
namespace Shogi.Contracts.Types
{
public enum WhichPiece
{
King,
GoldGeneral,
SilverGeneral,
Bishop,
Rook,
Knight,
Lance,
Pawn
}
}