Sorry, there's nothing at this address.
15 |
16 | @switch (userUnit.UnitId)
17 | {
18 | case 1:![]() ![]() ![]() |
23 | 24 | @UnitService.Units.First(unit => unit.Id == userUnit.UnitId).Title 25 | | 26 |27 | @userUnit.HitPoints HP 28 | | 29 |
Current count: @currentCount
6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /BlazorBattles/Client/Pages/Counter.razor.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace BlazorBattles.Client.Pages 8 | { 9 | public partial class Counter : ComponentBase 10 | { 11 | private int currentCount = 0; 12 | 13 | private void IncrementCount() 14 | { 15 | currentCount += 2; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /BlazorBattles/Client/Pages/FetchData.razor: -------------------------------------------------------------------------------- 1 | @page "/fetchdata" 2 | @using BlazorBattles.Shared 3 | @inject HttpClient Http 4 | 5 |This component demonstrates fetching data from the server.
8 | 9 | @if (forecasts == null) 10 | { 11 |Loading...
12 | } 13 | else 14 | { 15 |Date | 19 |Temp. (C) | 20 |Temp. (F) | 21 |Summary | 22 |
---|---|---|---|
@forecast.Date.ToShortDateString() | 29 |@forecast.TemperatureC | 30 |@forecast.TemperatureF | 31 |@forecast.Summary | 32 |
Date | 10 |Attacker | 11 |Opponent | 12 |Rounds | 13 |Damage | 14 |15 | |
---|---|---|---|---|---|
@battle.BattleDate | 22 |@battle.AttackerName | 23 |@battle.OpponentName | 24 |@battle.RoundsFought | 25 |@battle.WinnerDamageDealt | 26 |@(battle.YouWon ? "You won!" : "You lost!") | 27 |
# | 21 |User | 22 |Victories | 23 |Defeats | 24 |Battles | 25 |26 | |
---|---|---|---|---|---|
@entry.Rank | 33 |@entry.Username | 34 |@entry.Victories | 35 |@entry.Defeats | 36 |@entry.Battles | 37 |38 | @if (entry.UserId != myUserId) 39 | { 40 | 43 | } 44 | | 45 |