@using Shogi.Contracts.Types; @inject IShogiApi ShogiApi @inject AccountState Account;
@for (var rank = 9; rank > 0; rank--) { foreach (var file in Files) { var position = $"{file}{rank}"; var piece = session?.BoardState.Board[position];
} }
9 8 7 6 5 4 3 2 1
A B C D E F G H I
@code { [Parameter] public string? SessionName { get; set; } static readonly string[] Files = new[] { "A", "B", "C", "D", "E", "F", "G", "H", "I" }; WhichPlayer Perspective => Account.User?.Id == session?.Player1 ? WhichPlayer.Player1 : WhichPlayer.Player2; Session? session; string? selectedPosition; protected override async Task OnParametersSetAsync() { if (!string.IsNullOrWhiteSpace(SessionName)) { this.session = await ShogiApi.GetSession(SessionName); } } void OnClickTile(Piece? piece, string position) { } }