reworked Guild Wars 2 builds
total rework of RandomizeWithBoons
This commit is contained in:
parent
bc2983584c
commit
90794ed4a2
11 changed files with 879 additions and 247 deletions
|
@ -170,11 +170,11 @@ namespace Lieb.Data
|
|||
context.RaidSignUps.AddRange(signUps);
|
||||
context.SaveChanges();
|
||||
|
||||
GuildWars2Build healTempest = new GuildWars2Build() { BuildName = "HealTempest", Class = GuildWars2Class.Elementalist, EliteSpecialization = EliteSpecialization.Tempest, Heal = 5, Might = 5 };
|
||||
GuildWars2Build condiScourge = new GuildWars2Build() { BuildName = "CondiScourge", Class = GuildWars2Class.Necromancer, EliteSpecialization = EliteSpecialization.Scourge };
|
||||
GuildWars2Build quickBrand = new GuildWars2Build() { BuildName = "QuickBrand", Class = GuildWars2Class.Guard, EliteSpecialization = EliteSpecialization.Firebrand, Heal = 5, Quickness = 5 };
|
||||
GuildWars2Build alacregate = new GuildWars2Build() { BuildName = "Alacregate", Class = GuildWars2Class.Revenant, EliteSpecialization = EliteSpecialization.Renegade, Alacrity = 5 };
|
||||
GuildWars2Build chrono = new GuildWars2Build() { BuildName = "Chrono", Class = GuildWars2Class.Mesmer, EliteSpecialization = EliteSpecialization.Chronomancer, Alacrity = 5, Quickness = 5 };
|
||||
GuildWars2Build healTempest = new GuildWars2Build() { BuildName = "HealTempest", Class = GuildWars2Class.Elementalist, EliteSpecialization = EliteSpecialization.Tempest, Might = true, Alacrity = true, DamageType = DamageType.Heal };
|
||||
GuildWars2Build condiScourge = new GuildWars2Build() { BuildName = "CondiScourge", Class = GuildWars2Class.Necromancer, EliteSpecialization = EliteSpecialization.Scourge, DamageType = DamageType.Condition };
|
||||
GuildWars2Build quickBrand = new GuildWars2Build() { BuildName = "QuickBrand", Class = GuildWars2Class.Guard, EliteSpecialization = EliteSpecialization.Firebrand, Quickness = true, DamageType = DamageType.Condition };
|
||||
GuildWars2Build alacregate = new GuildWars2Build() { BuildName = "Alacregate", Class = GuildWars2Class.Revenant, EliteSpecialization = EliteSpecialization.Renegade, Alacrity = true, DamageType = DamageType.Power };
|
||||
GuildWars2Build chrono = new GuildWars2Build() { BuildName = "Chrono", Class = GuildWars2Class.Mesmer, EliteSpecialization = EliteSpecialization.Chronomancer, Alacrity = true, Quickness = true, DamageType = DamageType.Power };
|
||||
GuildWars2Build daredevil = new GuildWars2Build() { BuildName = "Daredevil", Class = GuildWars2Class.Thief, EliteSpecialization = EliteSpecialization.DareDevil };
|
||||
context.GuildWars2Builds.AddRange(new List<GuildWars2Build>(){healTempest, condiScourge, quickBrand, alacregate, chrono, daredevil });
|
||||
context.SaveChanges();
|
||||
|
|
|
@ -97,230 +97,135 @@ namespace Lieb.Data
|
|||
signUp.RaidRole = role;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void RandomizeWithBoons(Raid raid)
|
||||
{
|
||||
Dictionary<ulong, GuildWars2Build> signedUpUsers= new Dictionary<ulong, GuildWars2Build>();
|
||||
foreach (RaidSignUp signUp in raid.SignUps)
|
||||
int noGroups = (raid.SignUps.Where(s => s.SignUpType != SignUpType.Flex && s.SignUpType != SignUpType.SignedOff).Count() / 5) +1;
|
||||
|
||||
List<GuildWars2Account> usedAccounts = raid.SignUps.Where(s => s.GuildWars2Account != null && s.GuildWars2Account.EquippedBuilds.Count > 0).Select(s => s.GuildWars2Account).ToList();
|
||||
Dictionary<GuildWars2Account, GuildWars2Build> addedAccounts = new Dictionary<GuildWars2Account, GuildWars2Build>();
|
||||
|
||||
List<GuildWars2Account> alacHealers = usedAccounts.Where(a => a.EquippedBuilds.Where(b => b.GuildWars2Build.DamageType == DamageType.Heal && b.GuildWars2Build.Alacrity).Any()).ToList();
|
||||
List<GuildWars2Account> quickHealers = usedAccounts.Where(a => a.EquippedBuilds.Where(b => b.GuildWars2Build.DamageType == DamageType.Heal && b.GuildWars2Build.Quickness).Any()).ToList();
|
||||
List<GuildWars2Account> alacDps = usedAccounts.Where(a => a.EquippedBuilds.Where(b => b.GuildWars2Build.DamageType != DamageType.Heal && b.GuildWars2Build.Alacrity).Any()).ToList();
|
||||
List<GuildWars2Account> quickDps = usedAccounts.Where(a => a.EquippedBuilds.Where(b => b.GuildWars2Build.DamageType != DamageType.Heal && b.GuildWars2Build.Quickness).Any()).ToList();
|
||||
|
||||
List<Tuple<int, int>> possibleBoonCombinations = new List<Tuple<int, int>>();
|
||||
foreach(GuildWars2Account alac in alacHealers)
|
||||
{
|
||||
if (!signUp.IsExternalUser && signUp.GuildWars2Account.EquippedBuilds.Count > 0)
|
||||
foreach(GuildWars2Account quick in quickDps)
|
||||
{
|
||||
signedUpUsers.Add(signUp.LiebUserId.Value, signUp.GuildWars2Account.EquippedBuilds.ToList()[_random.Next(signUp.GuildWars2Account.EquippedBuilds.Count - 1)].GuildWars2Build);
|
||||
if(alac.GuildWars2AccountId != quick.GuildWars2AccountId)
|
||||
possibleBoonCombinations.Add(new Tuple<int, int>(alac.GuildWars2AccountId, quick.GuildWars2AccountId));
|
||||
}
|
||||
}
|
||||
BalanceRoles(raid, signedUpUsers);
|
||||
foreach(var userBuild in signedUpUsers)
|
||||
foreach(GuildWars2Account quick in quickHealers)
|
||||
{
|
||||
RaidRole role = new RaidRole();
|
||||
role.Spots = 0;
|
||||
role.Name = userBuild.Value.BuildName;
|
||||
raid.Roles.Add(role);
|
||||
RaidSignUp signUp = raid.SignUps.FirstOrDefault(s => s.LiebUserId == userBuild.Key);
|
||||
signUp.RaidRole = role;
|
||||
}
|
||||
}
|
||||
|
||||
private void BalanceRoles(Raid raid, Dictionary<ulong, GuildWars2Build> signedUpUsers, int recusrionDepth = 0)
|
||||
{
|
||||
int Alac = 0;
|
||||
int Quick = 0;
|
||||
int Heal = 0;
|
||||
int Might = 0;
|
||||
|
||||
signedUpUsers = signedUpUsers.OrderBy(u => _random.Next()).ToDictionary(u => u.Key, u => u.Value);
|
||||
|
||||
foreach(GuildWars2Build build in signedUpUsers.Values)
|
||||
{
|
||||
Alac += build.Alacrity;
|
||||
Quick += build.Quickness;
|
||||
Heal += build.Heal;
|
||||
Might += build.Might;
|
||||
}
|
||||
if(Alac > 10)
|
||||
{
|
||||
ReduceAlac(raid, signedUpUsers, Alac);
|
||||
}
|
||||
if(Alac < 10)
|
||||
{
|
||||
IncreaseAlac(raid, signedUpUsers, Alac);
|
||||
}
|
||||
signedUpUsers = signedUpUsers.OrderBy(u => _random.Next()).ToDictionary(u => u.Key, u => u.Value);
|
||||
if (Quick > 10)
|
||||
{
|
||||
ReduceQuick(raid, signedUpUsers, Quick);
|
||||
}
|
||||
if (Quick < 10)
|
||||
{
|
||||
IncreaseQuick(raid, signedUpUsers, Quick);
|
||||
}
|
||||
signedUpUsers = signedUpUsers.OrderBy(u => _random.Next()).ToDictionary(u => u.Key, u => u.Value);
|
||||
if (Heal > 10)
|
||||
{
|
||||
ReduceHeal(raid, signedUpUsers, Heal);
|
||||
}
|
||||
if (Heal < 10)
|
||||
{
|
||||
IncreaseHeal(raid, signedUpUsers, Heal);
|
||||
}
|
||||
signedUpUsers = signedUpUsers.OrderBy(u => _random.Next()).ToDictionary(u => u.Key, u => u.Value);
|
||||
if (Might > 10)
|
||||
{
|
||||
ReduceMight(raid, signedUpUsers, Might);
|
||||
}
|
||||
if (Might < 10)
|
||||
{
|
||||
IncreaseMight(raid, signedUpUsers, Might);
|
||||
}
|
||||
|
||||
if(recusrionDepth < 20)
|
||||
{
|
||||
recusrionDepth++;
|
||||
BalanceRoles(raid, signedUpUsers, recusrionDepth);
|
||||
}
|
||||
}
|
||||
|
||||
private void ReduceAlac(Raid raid, Dictionary<ulong, GuildWars2Build> signedUpUsers, int currentAlac)
|
||||
{
|
||||
foreach (var userBuild in signedUpUsers)
|
||||
{
|
||||
if(userBuild.Value.Alacrity > 0 && currentAlac > 10)
|
||||
foreach(GuildWars2Account alac in alacDps)
|
||||
{
|
||||
RaidSignUp signUp = raid.SignUps.FirstOrDefault(s => s.LiebUserId == userBuild.Key);
|
||||
Equipped newBuild = signUp.GuildWars2Account.EquippedBuilds.Where(b => b.GuildWars2Build.Alacrity == 0).OrderBy(u => _random.Next()).FirstOrDefault();
|
||||
if (newBuild != null)
|
||||
if(quick.GuildWars2AccountId != alac.GuildWars2AccountId)
|
||||
possibleBoonCombinations.Add(new Tuple<int, int>(quick.GuildWars2AccountId, alac.GuildWars2AccountId));
|
||||
}
|
||||
}
|
||||
|
||||
possibleBoonCombinations = possibleBoonCombinations.OrderBy(u => _random.Next()).ToList();
|
||||
List<Tuple<int, int>> usedBoonCombinations = new List<Tuple<int, int>>();
|
||||
foreach(var boonCombination in possibleBoonCombinations)
|
||||
{
|
||||
if(!usedBoonCombinations.Where(b => b.Item1 == boonCombination.Item1 || b.Item1 == boonCombination.Item2
|
||||
|| b.Item2 == boonCombination.Item1 || b.Item2 == boonCombination.Item2).Any()
|
||||
&& usedBoonCombinations.Count < noGroups)
|
||||
{
|
||||
usedBoonCombinations.Add(new Tuple<int, int>(boonCombination.Item1, boonCombination.Item2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//TODO: avoid the same GW2 account multiple times in a raid?
|
||||
foreach(var boonCombination in usedBoonCombinations)
|
||||
{
|
||||
GuildWars2Account healer = usedAccounts.First(a => a.GuildWars2AccountId == boonCombination.Item1);
|
||||
GuildWars2Account boonDps = usedAccounts.First(a => a.GuildWars2AccountId == boonCombination.Item2);
|
||||
Tuple<GuildWars2Build, GuildWars2Build> builds = GetBoonBuilds(healer, boonDps);
|
||||
AddRole(raid, builds.Item1, raid.SignUps.First(s => s.GuildWars2AccountId == boonCombination.Item1));
|
||||
addedAccounts.Add(healer, builds.Item1);
|
||||
AddRole(raid, builds.Item2, raid.SignUps.First(s => s.GuildWars2AccountId == boonCombination.Item2));
|
||||
addedAccounts.Add(boonDps, builds.Item2);
|
||||
}
|
||||
|
||||
//add aditional healers
|
||||
if(usedBoonCombinations.Count < noGroups)
|
||||
{
|
||||
List<GuildWars2Account> additionalHealers = usedAccounts.Where(a => a.EquippedBuilds.Where(b => b.GuildWars2Build.DamageType == DamageType.Heal).Any()
|
||||
&& !addedAccounts.Where(x => x.Key.GuildWars2AccountId == a.GuildWars2AccountId).Any()).ToList();
|
||||
additionalHealers = additionalHealers.OrderBy(u => _random.Next()).ToList();
|
||||
int neededHealers = noGroups - usedBoonCombinations.Count;
|
||||
foreach(GuildWars2Account healer in additionalHealers)
|
||||
{
|
||||
if(neededHealers > 0)
|
||||
{
|
||||
currentAlac -= userBuild.Value.Alacrity;
|
||||
signedUpUsers[userBuild.Key] = newBuild.GuildWars2Build;
|
||||
currentAlac += signedUpUsers[userBuild.Key].Alacrity;
|
||||
GuildWars2Build build = healer.EquippedBuilds.First(b => b.GuildWars2Build.DamageType == DamageType.Heal).GuildWars2Build;
|
||||
AddRole(raid, build, raid.SignUps.First(s => s.GuildWars2AccountId == healer.GuildWars2AccountId));
|
||||
addedAccounts.Add(healer, build);
|
||||
neededHealers --;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void IncreaseAlac(Raid raid, Dictionary<ulong, GuildWars2Build> signedUpUsers, int currentAlac)
|
||||
{
|
||||
foreach (var userBuild in signedUpUsers)
|
||||
//add might
|
||||
if(addedAccounts.Where(a => a.Value.Might).Count() < noGroups )
|
||||
{
|
||||
if (userBuild.Value.Alacrity == 00 && currentAlac < 10)
|
||||
List<GuildWars2Account> additionalMight = usedAccounts.Where(a => a.EquippedBuilds.Where(b => b.GuildWars2Build.DamageType != DamageType.Heal && b.GuildWars2Build.Might).Any()
|
||||
&& !addedAccounts.Where(x => x.Key.GuildWars2AccountId == a.GuildWars2AccountId).Any()).ToList();
|
||||
additionalMight = additionalMight.OrderBy(u => _random.Next()).ToList();
|
||||
int neededMight = noGroups - addedAccounts.Where(a => a.Value.Might).Count();
|
||||
foreach(GuildWars2Account mightAccount in additionalMight)
|
||||
{
|
||||
RaidSignUp signUp = raid.SignUps.FirstOrDefault(s => s.LiebUserId == userBuild.Key);
|
||||
Equipped newBuild = signUp.GuildWars2Account.EquippedBuilds.Where(b => b.GuildWars2Build.Alacrity > 0).OrderBy(u => _random.Next()).FirstOrDefault();
|
||||
if (newBuild != null)
|
||||
if(neededMight > 0)
|
||||
{
|
||||
currentAlac -= userBuild.Value.Alacrity;
|
||||
signedUpUsers[userBuild.Key] = newBuild.GuildWars2Build;
|
||||
currentAlac += signedUpUsers[userBuild.Key].Alacrity;
|
||||
GuildWars2Build build = mightAccount.EquippedBuilds.First(b => b.GuildWars2Build.DamageType != DamageType.Heal && b.GuildWars2Build.Might).GuildWars2Build;
|
||||
AddRole(raid, build, raid.SignUps.First(s => s.GuildWars2AccountId == mightAccount.GuildWars2AccountId));
|
||||
addedAccounts.Add(mightAccount, build);
|
||||
neededMight --;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ReduceQuick(Raid raid, Dictionary<ulong, GuildWars2Build> signedUpUsers, int currentQuick)
|
||||
{
|
||||
foreach (var userBuild in signedUpUsers)
|
||||
//add dps
|
||||
List<GuildWars2Account> dpsPlayers = usedAccounts.Where(a => !addedAccounts.Where(x => x.Key.GuildWars2AccountId == a.GuildWars2AccountId).Any()).ToList();
|
||||
foreach(GuildWars2Account dps in dpsPlayers)
|
||||
{
|
||||
if (userBuild.Value.Quickness > 0 && currentQuick > 10)
|
||||
{
|
||||
RaidSignUp signUp = raid.SignUps.FirstOrDefault(s => s.LiebUserId == userBuild.Key);
|
||||
Equipped newBuild = signUp.GuildWars2Account.EquippedBuilds.Where(b => b.GuildWars2Build.Quickness == 0).OrderBy(u => _random.Next()).FirstOrDefault();
|
||||
if (newBuild != null)
|
||||
{
|
||||
currentQuick -= userBuild.Value.Quickness;
|
||||
signedUpUsers[userBuild.Key] = newBuild.GuildWars2Build;
|
||||
currentQuick += signedUpUsers[userBuild.Key].Quickness;
|
||||
}
|
||||
}
|
||||
GuildWars2Build build = dps.EquippedBuilds.First(b => b.GuildWars2Build.DamageType != DamageType.Heal && !b.GuildWars2Build.Alacrity && !b.GuildWars2Build.Quickness).GuildWars2Build;
|
||||
AddRole(raid, build, raid.SignUps.First(s => s.GuildWars2AccountId == dps.GuildWars2AccountId));
|
||||
addedAccounts.Add(dps, build);
|
||||
}
|
||||
}
|
||||
|
||||
private void IncreaseQuick(Raid raid, Dictionary<ulong, GuildWars2Build> signedUpUsers, int currentQuick)
|
||||
private Tuple<GuildWars2Build, GuildWars2Build> GetBoonBuilds(GuildWars2Account healer, GuildWars2Account boonDps)
|
||||
{
|
||||
foreach (var userBuild in signedUpUsers)
|
||||
{
|
||||
if (userBuild.Value.Quickness == 00 && currentQuick < 10)
|
||||
{
|
||||
RaidSignUp signUp = raid.SignUps.FirstOrDefault(s => s.LiebUserId == userBuild.Key);
|
||||
Equipped newBuild = signUp.GuildWars2Account.EquippedBuilds.Where(b => b.GuildWars2Build.Quickness > 0).OrderBy(u => _random.Next()).FirstOrDefault();
|
||||
if (newBuild != null)
|
||||
{
|
||||
currentQuick -= userBuild.Value.Quickness;
|
||||
signedUpUsers[userBuild.Key] = newBuild.GuildWars2Build;
|
||||
currentQuick += signedUpUsers[userBuild.Key].Quickness;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
List<GuildWars2Build> healBuilds = healer.EquippedBuilds.Where(b => b.GuildWars2Build.DamageType == DamageType.Heal && (b.GuildWars2Build.Alacrity || b.GuildWars2Build.Quickness)).Select(b => b.GuildWars2Build).ToList();
|
||||
List<GuildWars2Build> boonBuilds = boonDps.EquippedBuilds.Where(b => b.GuildWars2Build.DamageType != DamageType.Heal && (b.GuildWars2Build.Alacrity || b.GuildWars2Build.Quickness)).Select(b => b.GuildWars2Build).ToList();
|
||||
healBuilds.OrderBy(u => _random.Next()).ToList();
|
||||
boonBuilds.OrderBy(u => _random.Next()).ToList();
|
||||
|
||||
private void ReduceMight(Raid raid, Dictionary<ulong, GuildWars2Build> signedUpUsers, int currentMight)
|
||||
{
|
||||
foreach (var userBuild in signedUpUsers)
|
||||
foreach(GuildWars2Build healBuild in healBuilds)
|
||||
{
|
||||
if (userBuild.Value.Might > 0 && currentMight > 10)
|
||||
if(boonBuilds.Where(b => b.Alacrity != healBuild.Alacrity).Any())
|
||||
{
|
||||
RaidSignUp signUp = raid.SignUps.FirstOrDefault(s => s.LiebUserId == userBuild.Key);
|
||||
Equipped newBuild = signUp.GuildWars2Account.EquippedBuilds.Where(b => b.GuildWars2Build.Might == 0).OrderBy(u => _random.Next()).FirstOrDefault();
|
||||
if (newBuild != null)
|
||||
{
|
||||
currentMight -= userBuild.Value.Might;
|
||||
signedUpUsers[userBuild.Key] = newBuild.GuildWars2Build;
|
||||
currentMight += signedUpUsers[userBuild.Key].Might;
|
||||
}
|
||||
GuildWars2Build boonBuild = boonBuilds.First(b => b.Alacrity != healBuild.Alacrity);
|
||||
return new Tuple<GuildWars2Build, GuildWars2Build>(healBuild, boonBuild);
|
||||
}
|
||||
}
|
||||
return new Tuple<GuildWars2Build, GuildWars2Build>(new GuildWars2Build(), new GuildWars2Build());
|
||||
}
|
||||
|
||||
private void IncreaseMight(Raid raid, Dictionary<ulong, GuildWars2Build> signedUpUsers, int currentMight)
|
||||
|
||||
private void AddRole(Raid raid, GuildWars2Build usedBuild, RaidSignUp signUp )
|
||||
{
|
||||
foreach (var userBuild in signedUpUsers)
|
||||
{
|
||||
if (userBuild.Value.Might == 00 && currentMight < 10)
|
||||
{
|
||||
RaidSignUp signUp = raid.SignUps.FirstOrDefault(s => s.LiebUserId == userBuild.Key);
|
||||
Equipped newBuild = signUp.GuildWars2Account.EquippedBuilds.Where(b => b.GuildWars2Build.Might > 0).OrderBy(u => _random.Next()).FirstOrDefault();
|
||||
if (newBuild != null)
|
||||
{
|
||||
currentMight -= userBuild.Value.Might;
|
||||
signedUpUsers[userBuild.Key] = newBuild.GuildWars2Build;
|
||||
currentMight += signedUpUsers[userBuild.Key].Might;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ReduceHeal(Raid raid, Dictionary<ulong, GuildWars2Build> signedUpUsers, int currentHeal)
|
||||
{
|
||||
foreach (var userBuild in signedUpUsers)
|
||||
{
|
||||
if (userBuild.Value.Heal > 0 && currentHeal > 10)
|
||||
{
|
||||
RaidSignUp signUp = raid.SignUps.FirstOrDefault(s => s.LiebUserId == userBuild.Key);
|
||||
Equipped newBuild = signUp.GuildWars2Account.EquippedBuilds.Where(b => b.GuildWars2Build.Heal == 0).OrderBy(u => _random.Next()).FirstOrDefault();
|
||||
if (newBuild != null)
|
||||
{
|
||||
currentHeal -= userBuild.Value.Heal;
|
||||
signedUpUsers[userBuild.Key] = newBuild.GuildWars2Build;
|
||||
currentHeal += signedUpUsers[userBuild.Key].Heal;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void IncreaseHeal(Raid raid, Dictionary<ulong, GuildWars2Build> signedUpUsers, int currentHeal)
|
||||
{
|
||||
foreach (var userBuild in signedUpUsers)
|
||||
{
|
||||
if (userBuild.Value.Heal == 00 && currentHeal < 10)
|
||||
{
|
||||
RaidSignUp signUp = raid.SignUps.FirstOrDefault(s => s.LiebUserId == userBuild.Key);
|
||||
Equipped newBuild = signUp.GuildWars2Account.EquippedBuilds.Where(b => b.GuildWars2Build.Heal > 0).OrderBy(u => _random.Next()).FirstOrDefault();
|
||||
if (newBuild != null)
|
||||
{
|
||||
currentHeal -= userBuild.Value.Heal;
|
||||
signedUpUsers[userBuild.Key] = newBuild.GuildWars2Build;
|
||||
currentHeal += signedUpUsers[userBuild.Key].Heal;
|
||||
}
|
||||
}
|
||||
}
|
||||
RaidRole role = new RaidRole();
|
||||
role.Spots = 0;
|
||||
role.Name = usedBuild.BuildName;
|
||||
raid.Roles.Add(role);
|
||||
signUp.RaidRole = role;
|
||||
}
|
||||
|
||||
private void CleanUpRoles(Raid raid, LiebContext context)
|
||||
|
|
640
Lieb/Migrations/20221205213924_ReworkedGW2Build.Designer.cs
generated
Normal file
640
Lieb/Migrations/20221205213924_ReworkedGW2Build.Designer.cs
generated
Normal file
|
@ -0,0 +1,640 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using Lieb.Data;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Lieb.Migrations
|
||||
{
|
||||
[DbContext(typeof(LiebContext))]
|
||||
[Migration("20221205213924_ReworkedGW2Build")]
|
||||
partial class ReworkedGW2Build
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "6.0.10");
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.DiscordSettings", b =>
|
||||
{
|
||||
b.Property<ulong>("DiscordSettingsId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("ChangeUserNames")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<ulong>("DiscordLogChannel")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("DiscordSettingsId");
|
||||
|
||||
b.ToTable("DiscordSettings", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.Equipped", b =>
|
||||
{
|
||||
b.Property<int>("EquippedId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("CanTank")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GuildWars2AccountId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("GuildWars2BuildId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("EquippedId");
|
||||
|
||||
b.HasIndex("GuildWars2AccountId");
|
||||
|
||||
b.HasIndex("GuildWars2BuildId");
|
||||
|
||||
b.ToTable("Equipped", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.GuildWars2Account", b =>
|
||||
{
|
||||
b.Property<int>("GuildWars2AccountId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("AccountName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("ApiKey")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<ulong?>("LiebUserId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GuildWars2AccountId");
|
||||
|
||||
b.HasIndex("LiebUserId");
|
||||
|
||||
b.ToTable("GuildWars2Account", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.GuildWars2Build", b =>
|
||||
{
|
||||
b.Property<int>("GuildWars2BuildId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("Alacrity")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("BuildName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(60)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Class")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("DamageType")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("EliteSpecialization")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("Might")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("Quickness")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Source")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("UseInRandomRaid")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GuildWars2BuildId");
|
||||
|
||||
b.ToTable("GuildWars2Build", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.Raid.DiscordRaidMessage", b =>
|
||||
{
|
||||
b.Property<int>("DiscordRaidMessageId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<ulong>("DiscordChannelId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<ulong>("DiscordGuildId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<ulong>("DiscordMessageId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("RaidId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("RaidTemplateId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("DiscordRaidMessageId");
|
||||
|
||||
b.HasIndex("RaidId");
|
||||
|
||||
b.HasIndex("RaidTemplateId");
|
||||
|
||||
b.ToTable("DiscordRaidMessage", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.Raid.Raid", b =>
|
||||
{
|
||||
b.Property<int>("RaidId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTimeOffset>("EndTimeUTC")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("EventType")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTimeOffset>("FreeForAllTimeUTC")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Guild")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("MoveFlexUsers")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Organizer")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<ulong?>("RaidOwnerId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("RaidType")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("RequiredRole")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTimeOffset>("StartTimeUTC")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("VoiceChat")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("RaidId");
|
||||
|
||||
b.ToTable("Raid", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.Raid.RaidReminder", b =>
|
||||
{
|
||||
b.Property<int>("RaidReminderId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<ulong>("DiscordChannelId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<ulong>("DiscordServerId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("RaidId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("RaidTemplateId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTimeOffset>("ReminderTimeUTC")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("Sent")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("TimeType")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("RaidReminderId");
|
||||
|
||||
b.HasIndex("RaidId");
|
||||
|
||||
b.HasIndex("RaidTemplateId");
|
||||
|
||||
b.ToTable("RaidReminder", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.Raid.RaidRole", b =>
|
||||
{
|
||||
b.Property<int>("RaidRoleId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsRandomSignUpRole")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("RaidId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int?>("RaidTemplateId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Spots")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("RaidRoleId");
|
||||
|
||||
b.HasIndex("RaidId");
|
||||
|
||||
b.HasIndex("RaidTemplateId");
|
||||
|
||||
b.ToTable("RaidRole", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.Raid.RaidSignUp", b =>
|
||||
{
|
||||
b.Property<int>("RaidSignUpId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("ExternalUserName")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("GuildWars2AccountId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<ulong?>("LiebUserId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("RaidId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("RaidRoleId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("SignUpType")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("RaidSignUpId");
|
||||
|
||||
b.HasIndex("GuildWars2AccountId");
|
||||
|
||||
b.HasIndex("LiebUserId");
|
||||
|
||||
b.HasIndex("RaidId");
|
||||
|
||||
b.HasIndex("RaidRoleId");
|
||||
|
||||
b.ToTable("RaidSignUp", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.Raid.RaidTemplate", b =>
|
||||
{
|
||||
b.Property<int>("RaidTemplateId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("CreateDaysBefore")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasMaxLength(1000)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("EndTime")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("EventType")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime>("FreeForAllTime")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Guild")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Interval")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("MoveFlexUsers")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Organizer")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<ulong?>("RaidOwnerId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("RaidType")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("RequiredRole")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("StartTime")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("TimeZone")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("VoiceChat")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("RaidTemplateId");
|
||||
|
||||
b.ToTable("RaidTemplate", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.LiebRole", b =>
|
||||
{
|
||||
b.Property<int>("LiebRoleId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("Level")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("LevelToAssign")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("RoleName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("LiebRoleId");
|
||||
|
||||
b.ToTable("LiebRole", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.LiebUser", b =>
|
||||
{
|
||||
b.Property<ulong>("Id")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<bool>("AlwaysSignUpWithMainAccount")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<DateTime?>("BannedUntil")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime?>("Birthday")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int>("MainGW2Account")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(40)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("Pronouns")
|
||||
.IsRequired()
|
||||
.HasMaxLength(60)
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("LiebUser", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.RoleAssignment", b =>
|
||||
{
|
||||
b.Property<int>("RoleAssignmentId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("LiebRoleId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<ulong>("LiebUserId")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("RoleAssignmentId");
|
||||
|
||||
b.HasIndex("LiebRoleId");
|
||||
|
||||
b.HasIndex("LiebUserId");
|
||||
|
||||
b.ToTable("RoleAssignment", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.Equipped", b =>
|
||||
{
|
||||
b.HasOne("Lieb.Models.GuildWars2.GuildWars2Account", "GuildWars2Account")
|
||||
.WithMany("EquippedBuilds")
|
||||
.HasForeignKey("GuildWars2AccountId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Lieb.Models.GuildWars2.GuildWars2Build", "GuildWars2Build")
|
||||
.WithMany("EquippedRoles")
|
||||
.HasForeignKey("GuildWars2BuildId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("GuildWars2Account");
|
||||
|
||||
b.Navigation("GuildWars2Build");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.GuildWars2Account", b =>
|
||||
{
|
||||
b.HasOne("Lieb.Models.LiebUser", null)
|
||||
.WithMany("GuildWars2Accounts")
|
||||
.HasForeignKey("LiebUserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.Raid.DiscordRaidMessage", b =>
|
||||
{
|
||||
b.HasOne("Lieb.Models.GuildWars2.Raid.Raid", null)
|
||||
.WithMany("DiscordRaidMessages")
|
||||
.HasForeignKey("RaidId");
|
||||
|
||||
b.HasOne("Lieb.Models.GuildWars2.Raid.RaidTemplate", null)
|
||||
.WithMany("DiscordRaidMessages")
|
||||
.HasForeignKey("RaidTemplateId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.Raid.RaidReminder", b =>
|
||||
{
|
||||
b.HasOne("Lieb.Models.GuildWars2.Raid.Raid", null)
|
||||
.WithMany("Reminders")
|
||||
.HasForeignKey("RaidId");
|
||||
|
||||
b.HasOne("Lieb.Models.GuildWars2.Raid.RaidTemplate", null)
|
||||
.WithMany("Reminders")
|
||||
.HasForeignKey("RaidTemplateId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.Raid.RaidRole", b =>
|
||||
{
|
||||
b.HasOne("Lieb.Models.GuildWars2.Raid.Raid", null)
|
||||
.WithMany("Roles")
|
||||
.HasForeignKey("RaidId");
|
||||
|
||||
b.HasOne("Lieb.Models.GuildWars2.Raid.RaidTemplate", null)
|
||||
.WithMany("Roles")
|
||||
.HasForeignKey("RaidTemplateId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.Raid.RaidSignUp", b =>
|
||||
{
|
||||
b.HasOne("Lieb.Models.GuildWars2.GuildWars2Account", "GuildWars2Account")
|
||||
.WithMany()
|
||||
.HasForeignKey("GuildWars2AccountId");
|
||||
|
||||
b.HasOne("Lieb.Models.LiebUser", "LiebUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("LiebUserId");
|
||||
|
||||
b.HasOne("Lieb.Models.GuildWars2.Raid.Raid", "Raid")
|
||||
.WithMany("SignUps")
|
||||
.HasForeignKey("RaidId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Lieb.Models.GuildWars2.Raid.RaidRole", "RaidRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("RaidRoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("GuildWars2Account");
|
||||
|
||||
b.Navigation("LiebUser");
|
||||
|
||||
b.Navigation("Raid");
|
||||
|
||||
b.Navigation("RaidRole");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.RoleAssignment", b =>
|
||||
{
|
||||
b.HasOne("Lieb.Models.LiebRole", "LiebRole")
|
||||
.WithMany("RoleAssignments")
|
||||
.HasForeignKey("LiebRoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Lieb.Models.LiebUser", "LiebUser")
|
||||
.WithMany("RoleAssignments")
|
||||
.HasForeignKey("LiebUserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("LiebRole");
|
||||
|
||||
b.Navigation("LiebUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.GuildWars2Account", b =>
|
||||
{
|
||||
b.Navigation("EquippedBuilds");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.GuildWars2Build", b =>
|
||||
{
|
||||
b.Navigation("EquippedRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.Raid.Raid", b =>
|
||||
{
|
||||
b.Navigation("DiscordRaidMessages");
|
||||
|
||||
b.Navigation("Reminders");
|
||||
|
||||
b.Navigation("Roles");
|
||||
|
||||
b.Navigation("SignUps");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.GuildWars2.Raid.RaidTemplate", b =>
|
||||
{
|
||||
b.Navigation("DiscordRaidMessages");
|
||||
|
||||
b.Navigation("Reminders");
|
||||
|
||||
b.Navigation("Roles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.LiebRole", b =>
|
||||
{
|
||||
b.Navigation("RoleAssignments");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Lieb.Models.LiebUser", b =>
|
||||
{
|
||||
b.Navigation("GuildWars2Accounts");
|
||||
|
||||
b.Navigation("RoleAssignments");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
47
Lieb/Migrations/20221205213924_ReworkedGW2Build.cs
Normal file
47
Lieb/Migrations/20221205213924_ReworkedGW2Build.cs
Normal file
|
@ -0,0 +1,47 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Lieb.Migrations
|
||||
{
|
||||
public partial class ReworkedGW2Build : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Heal",
|
||||
table: "GuildWars2Build",
|
||||
newName: "UseInRandomRaid");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "DamageType",
|
||||
table: "GuildWars2Build",
|
||||
type: "INTEGER",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Source",
|
||||
table: "GuildWars2Build",
|
||||
type: "TEXT",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DamageType",
|
||||
table: "GuildWars2Build");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Source",
|
||||
table: "GuildWars2Build");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "UseInRandomRaid",
|
||||
table: "GuildWars2Build",
|
||||
newName: "Heal");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -88,7 +88,7 @@ namespace Lieb.Migrations
|
|||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<short>("Alacrity")
|
||||
b.Property<bool>("Alacrity")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("BuildName")
|
||||
|
@ -99,16 +99,23 @@ namespace Lieb.Migrations
|
|||
b.Property<int>("Class")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("DamageType")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<int>("EliteSpecialization")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<short>("Heal")
|
||||
b.Property<bool>("Might")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<short>("Might")
|
||||
b.Property<bool>("Quickness")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<short>("Quickness")
|
||||
b.Property<string>("Source")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("UseInRandomRaid")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.HasKey("GuildWars2BuildId");
|
||||
|
|
|
@ -3,5 +3,8 @@ https://learn.microsoft.com/en-us/aspnet/core/data/ef-rp/migrations?view=aspnetc
|
|||
open ProjectFolder in Terminal
|
||||
dotnet ef migrations add InitialCreate
|
||||
|
||||
remove migrations with
|
||||
remove migrations
|
||||
1: revert to migration you want to keep
|
||||
dotnet ef database update RemovedRaidLog
|
||||
2: remove
|
||||
dotnet ef migrations remove
|
|
@ -2,15 +2,13 @@
|
|||
|
||||
namespace Lieb.Models.GuildWars2
|
||||
{
|
||||
public enum Role
|
||||
public enum DamageType
|
||||
{
|
||||
Might = 0,
|
||||
Quickness = 1,
|
||||
Alacrity = 2,
|
||||
Heal = 3,
|
||||
Tank = 4,
|
||||
pDps = 5,
|
||||
cDps = 6,
|
||||
Other = 0,
|
||||
Heal = 1,
|
||||
Power = 2,
|
||||
Condition = 3,
|
||||
Hybrid = 4
|
||||
}
|
||||
|
||||
public enum GuildWars2Class
|
||||
|
@ -74,10 +72,11 @@ namespace Lieb.Models.GuildWars2
|
|||
[StringLength(60, ErrorMessage = "BuildName too long (60 character limit).")]
|
||||
public string BuildName { get; set; } = String.Empty;
|
||||
|
||||
public short Might { get; set; }
|
||||
public short Quickness { get; set; }
|
||||
public short Alacrity { get; set; }
|
||||
public short Heal { get; set; }
|
||||
public bool Might { get; set; }
|
||||
public bool Quickness { get; set; }
|
||||
public bool Alacrity { get; set; }
|
||||
public DamageType DamageType {get; set;}
|
||||
public bool UseInRandomRaid {get; set;}
|
||||
|
||||
[Required]
|
||||
[Range(1, 9, ErrorMessage = "Please select a class")]
|
||||
|
@ -89,5 +88,7 @@ namespace Lieb.Models.GuildWars2
|
|||
|
||||
public ICollection<Equipped> EquippedRoles { get; set; } = new List<Equipped>();
|
||||
|
||||
public string Source {get; set;} = string.Empty;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -11,7 +11,7 @@ main {
|
|||
}
|
||||
|
||||
.sidebar {
|
||||
background-image: linear-gradient(180deg, rgb(21 11 181) 0%, #19784c 70%);
|
||||
background-image: linear-gradient(180deg, rgb(0 0 0) 0%, #932c36 70%);
|
||||
}
|
||||
|
||||
.loginText {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue