Replace MSAL and custom cookie auth with Microsoft.Identity.EntityFramework Also some UI redesign to accommodate different login experience.
58 lines
1.3 KiB
Plaintext
58 lines
1.3 KiB
Plaintext
@using Shogi.Contracts.Types
|
|
|
|
<div class="game-piece" title="@HtmlTitle" 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;
|
|
|
|
private string HtmlTitle => Piece?.WhichPiece switch
|
|
{
|
|
WhichPiece.Bishop => "Bishop",
|
|
WhichPiece.GoldGeneral => "Gold General",
|
|
WhichPiece.King => "King",
|
|
WhichPiece.Knight => "Knight",
|
|
WhichPiece.Lance => "Lance",
|
|
WhichPiece.Pawn => "Pawn",
|
|
WhichPiece.Rook => "Rook",
|
|
WhichPiece.SilverGeneral => "Silver General",
|
|
_ => string.Empty
|
|
};
|
|
}
|