diff --git a/Shogi.UI/Pages/Play/GameBoard/GameBoardPresentation.razor b/Shogi.UI/Pages/Play/GameBoard/GameBoardPresentation.razor index d86fbaa..d069266 100644 --- a/Shogi.UI/Pages/Play/GameBoard/GameBoardPresentation.razor +++ b/Shogi.UI/Pages/Play/GameBoard/GameBoardPresentation.razor @@ -70,13 +70,13 @@ } } -
Opponent Hand
+Opponent's Hand
Hand
+Your Hand
@if (IsTurn)
{
- *
+ Turn
+
+ }
+
+ @if (InCheck)
+ {
+ Check
+
}
@if (string.IsNullOrEmpty(Name))
@@ -17,5 +24,6 @@
@code {
[Parameter][EditorRequired] public bool IsTurn { get; set; }
+ [Parameter][EditorRequired] public bool InCheck { get; set; }
[Parameter][EditorRequired] public string Name { get; set; } = string.Empty;
}
diff --git a/Shogi.UI/Pages/Play/GameBoard/PlayerName.razor.css b/Shogi.UI/Pages/Play/GameBoard/PlayerName.razor.css
new file mode 100644
index 0000000..9be37f4
--- /dev/null
+++ b/Shogi.UI/Pages/Play/GameBoard/PlayerName.razor.css
@@ -0,0 +1,17 @@
+.turn-marker {
+ display: inline-block;
+ padding: 3px 8px;
+ background-color: #444;
+ color: beige;
+ font-weight: bold;
+ font-size: 80%;
+}
+
+.check-marker {
+ display: inline-block;
+ padding: 3px 8px;
+ background-color: darkred;
+ color: beige;
+ font-weight: bold;
+ font-size: 80%;
+}
diff --git a/Shogi.UI/Pages/Play/GameBoard/SeatedGameBoard.razor b/Shogi.UI/Pages/Play/GameBoard/SeatedGameBoard.razor
index 1a2c285..97fd6dc 100644
--- a/Shogi.UI/Pages/Play/GameBoard/SeatedGameBoard.razor
+++ b/Shogi.UI/Pages/Play/GameBoard/SeatedGameBoard.razor
@@ -10,8 +10,7 @@
OnClickHand="OnClickHand"
OnClickTile="OnClickTile"
SelectedPosition="@selectedBoardPosition"
- SelectedPieceFromHand="@selectedPieceFromHand"
- IsMyTurn="IsMyTurn" />
+ SelectedPieceFromHand="@selectedPieceFromHand" />
@if (showPromotePrompt)
{
@@ -33,7 +32,6 @@
public WhichPlayer Perspective { get; set; }
[Parameter, EditorRequired]
public Session Session { get; set; } = default!;
- private bool IsMyTurn => Session?.BoardState.WhoseTurn == Perspective;
private string? selectedBoardPosition;
private WhichPiece? selectedPieceFromHand;
private bool showPromotePrompt;
@@ -65,7 +63,7 @@
async Task OnClickTile(string position)
{
- if (!IsMyTurn || showPromotePrompt) return;
+ if (showPromotePrompt) return;
var pieceAtPosition = Session.BoardState.Board[position];
if (selectedBoardPosition == position)
@@ -133,7 +131,7 @@
void OnClickHand(Piece piece)
{
- if (!IsMyTurn || showPromotePrompt) return;
+ if (showPromotePrompt) return;
// Prevent selecting from both the hand and the board.
selectedBoardPosition = null;
diff --git a/Shogi.UI/Shogi.UI.csproj b/Shogi.UI/Shogi.UI.csproj
index a44d5de..86c2856 100644
--- a/Shogi.UI/Shogi.UI.csproj
+++ b/Shogi.UI/Shogi.UI.csproj
@@ -15,12 +15,14 @@