squash a bunch of commits
This commit is contained in:
44
Shogi.UI/Pages/Home/GamePiece.razor
Normal file
44
Shogi.UI/Pages/Home/GamePiece.razor
Normal file
@@ -0,0 +1,44 @@
|
||||
@using Shogi.Contracts.Types
|
||||
|
||||
<div data-upsidedown="@(Piece?.Owner != Perspective)" data-owner="@Piece?.Owner.ToString()">
|
||||
@switch (Piece?.WhichPiece)
|
||||
{
|
||||
case WhichPiece.Bishop:
|
||||
<Bishop IsPromoted="@IsPromoted" />
|
||||
break;
|
||||
case WhichPiece.GoldGeneral:
|
||||
<GoldGeneral />
|
||||
break;
|
||||
case WhichPiece.King:
|
||||
<ChallengingKing />
|
||||
break;
|
||||
case WhichPiece.Knight:
|
||||
<Knight IsPromoted="@IsPromoted" />
|
||||
break;
|
||||
case WhichPiece.Lance:
|
||||
<Lance IsPromoted="@IsPromoted" />
|
||||
break;
|
||||
case WhichPiece.Pawn:
|
||||
<Pawn IsPromoted="@IsPromoted" />
|
||||
break;
|
||||
case WhichPiece.Rook:
|
||||
<Rook IsPromoted="@IsPromoted" />
|
||||
break;
|
||||
case WhichPiece.SilverGeneral:
|
||||
<SilverGeneral IsPromoted="@IsPromoted" />
|
||||
break;
|
||||
default:
|
||||
@*render nothing*@
|
||||
break;
|
||||
}
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public Contracts.Types.Piece? Piece { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public WhichPlayer Perspective { get; set; }
|
||||
|
||||
private bool IsPromoted => Piece != null && Piece.IsPromoted;
|
||||
}
|
||||
Reference in New Issue
Block a user