reworked Guild Wars 2 builds

total rework of RandomizeWithBoons
This commit is contained in:
Sarah Faey 2022-12-06 01:14:53 +01:00
parent bc2983584c
commit 90794ed4a2
11 changed files with 879 additions and 247 deletions

View file

@ -23,28 +23,40 @@
<p>
<label>
<InputCheckbox @bind-Value="_hasMight" />
<InputCheckbox @bind-Value="_build.UseInRandomRaid" />
Use for random raids
</label>
</p>
<p>
<label>
<InputCheckbox @bind-Value="_build.Might" />
Might
</label>
</p>
<p>
<label>
<InputCheckbox @bind-Value="_hasHeal" />
Heal
</label>
</p>
<p>
<label>
<InputCheckbox @bind-Value="_hasQuickness" />
<InputCheckbox @bind-Value="_build.Quickness" />
Quickness
</label>
</p>
<p>
<label>
<InputCheckbox @bind-Value="_hasAlacrity" />
<InputCheckbox @bind-Value="_build.Alacrity" />
Alacrity
</label>
</p>
<p>
<label>
Damage Type:
<InputSelect @bind-Value="_build.DamageType">
@foreach(DamageType damageType in Enum.GetValues(typeof(DamageType)))
{
<option value="@damageType">@damageType.ToString()</option>
}
</InputSelect>
</label>
</p>
<p>
<label>
@ -68,6 +80,12 @@
</InputSelect>
</label>
</p>
<p>
<label>
Source:
<InputText @bind-Value="_build.Source" />
</label>
</p>
<ValidationSummary />
<button type="submit">Submit</button>
@ -85,20 +103,12 @@
public GuildWars2Build _build;
private bool _hasMight;
private bool _hasHeal;
private bool _hasQuickness;
private bool _hasAlacrity;
protected override async Task OnInitializedAsync()
{
if(!string.IsNullOrEmpty(buildId) && int.TryParse(buildId, out int parsedId))
{
_build = GuildWars2BuildService.GetBuild(parsedId);
_hasMight = _build.Might > 0;
_hasHeal = _build.Heal > 0;
_hasQuickness = _build.Quickness > 0;
_hasAlacrity = _build.Alacrity > 0;
}
else
{
@ -118,11 +128,6 @@
private async Task HandleValidSubmit()
{
_build.Might = _hasMight ? (short)5 : (short)0;
_build.Heal = _hasHeal ? (short)5 : (short)0;
_build.Quickness = _hasQuickness ? (short)5 : (short)0;
_build.Alacrity = _hasAlacrity ? (short)5 : (short)0;
await GuildWars2BuildService.AddOrEditBuild(_build);
NavigationManager.NavigateTo("buildoverview");
}

View file

@ -32,9 +32,15 @@
<th>Class</th>
<th>Elite</th>
<th>Might</th>
<th>Heal</th>
<th>Quick</th>
<th>Alac</th>
<th>Heal</th>
<th>Power</th>
<th>Condition</th>
<th>Hybrid</th>
<th>Other</th>
<th>Random</th>
<th>Source</th>
</tr>
@foreach (var build in _buildsToShow.OrderBy(b => b.Class).ThenBy(b => b.EliteSpecialization))
{
@ -45,10 +51,16 @@
</td>
<td>@build.Class.ToString()</td>
<td>@build.EliteSpecialization.ToString()</td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.Might > 0)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.Heal > 0)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.Quickness > 0)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.Alacrity > 0)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.Might)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.Quickness)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.Alacrity)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.DamageType == DamageType.Heal)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.DamageType == DamageType.Power)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.DamageType == DamageType.Condition)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.DamageType == DamageType.Hybrid)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.DamageType == DamageType.Other)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.UseInRandomRaid)" disabled="disabled" /></td>
<td>@build.Source</td>
</tr>
}
</table>

View file

@ -60,9 +60,15 @@
<th>Class</th>
<th>Elite</th>
<th>Might</th>
<th>Heal</th>
<th>Quick</th>
<th>Alac</th>
<th>Heal</th>
<th>Power</th>
<th>Condition</th>
<th>Hybrid</th>
<th>Other</th>
<th>Random</th>
<th>Source</th>
</tr>
@foreach (GuildWars2Build build in _buildsToShow.OrderBy(b => b.Class).ThenBy(b => b.EliteSpecialization))
{
@ -80,10 +86,16 @@
<td>@build.BuildName</td>
<td>@build.Class.ToString()</td>
<td>@build.EliteSpecialization.ToString()</td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.Might > 0)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.Heal > 0)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.Quickness > 0)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.Alacrity > 0)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.Might)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.Quickness)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.Alacrity)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.DamageType == DamageType.Heal)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.DamageType == DamageType.Power)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.DamageType == DamageType.Condition)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.DamageType == DamageType.Hybrid)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.DamageType == DamageType.Other)" disabled="disabled" /></td>
<td class="checkboxfield"><input type="checkbox" checked="@(build.UseInRandomRaid)" disabled="disabled" /></td>
<td>@build.Source</td>
</tr>
}
</table>