squash a bunch of commits
This commit is contained in:
14
Shogi.Contracts/Types/BoardState.cs
Normal file
14
Shogi.Contracts/Types/BoardState.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
12
Shogi.Contracts/Types/Move.cs
Normal file
12
Shogi.Contracts/Types/Move.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
9
Shogi.Contracts/Types/Piece.cs
Normal file
9
Shogi.Contracts/Types/Piece.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
10
Shogi.Contracts/Types/Session.cs
Normal file
10
Shogi.Contracts/Types/Session.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
8
Shogi.Contracts/Types/SessionMetadata.cs
Normal file
8
Shogi.Contracts/Types/SessionMetadata.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Shogi.Contracts.Types
|
||||
{
|
||||
public class SessionMetadata
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int PlayerCount { get; set; }
|
||||
}
|
||||
}
|
||||
9
Shogi.Contracts/Types/SocketAction.cs
Normal file
9
Shogi.Contracts/Types/SocketAction.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Shogi.Contracts.Types
|
||||
{
|
||||
public enum SocketAction
|
||||
{
|
||||
SessionCreated,
|
||||
SessionJoined,
|
||||
PieceMoved
|
||||
}
|
||||
}
|
||||
9
Shogi.Contracts/Types/User.cs
Normal file
9
Shogi.Contracts/Types/User.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
8
Shogi.Contracts/Types/WhichPerspective.cs
Normal file
8
Shogi.Contracts/Types/WhichPerspective.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Shogi.Contracts.Types
|
||||
{
|
||||
public enum WhichPlayer
|
||||
{
|
||||
Player1,
|
||||
Player2
|
||||
}
|
||||
}
|
||||
14
Shogi.Contracts/Types/WhichPiece.cs
Normal file
14
Shogi.Contracts/Types/WhichPiece.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Shogi.Contracts.Types
|
||||
{
|
||||
public enum WhichPiece
|
||||
{
|
||||
King,
|
||||
GoldGeneral,
|
||||
SilverGeneral,
|
||||
Bishop,
|
||||
Rook,
|
||||
Knight,
|
||||
Lance,
|
||||
Pawn
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user