Group pieces in the hand.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
@using Shogi.Contracts.Types
|
||||
|
||||
<div class="game-piece" title="@HtmlTitle" data-upsidedown="@(Piece?.Owner != Perspective)" data-owner="@Piece?.Owner.ToString()">
|
||||
@switch (Piece?.WhichPiece)
|
||||
<div class="game-piece" title="@HtmlTitle">
|
||||
@switch (Piece)
|
||||
{
|
||||
case WhichPiece.Bishop:
|
||||
<Bishop IsPromoted="@IsPromoted" />
|
||||
@@ -31,18 +31,18 @@
|
||||
@*render nothing*@
|
||||
break;
|
||||
}
|
||||
@if (Count > 0)
|
||||
{
|
||||
<span class="counter">@Count</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public Contracts.Types.Piece? Piece { get; set; }
|
||||
[Parameter] public WhichPiece? Piece { get; set; }
|
||||
[Parameter] public bool IsPromoted { get; set; }
|
||||
[Parameter] public int Count { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public WhichPlayer Perspective { get; set; }
|
||||
|
||||
private bool IsPromoted => Piece != null && Piece.IsPromoted;
|
||||
|
||||
private string HtmlTitle => Piece?.WhichPiece switch
|
||||
private string HtmlTitle => Piece switch
|
||||
{
|
||||
WhichPiece.Bishop => "Bishop",
|
||||
WhichPiece.GoldGeneral => "Gold General",
|
||||
|
||||
Reference in New Issue
Block a user