reworked Model

This commit is contained in:
t.ruspekhofer 2022-02-22 00:28:48 +01:00
parent 15608f0e31
commit 04049f31f6
12 changed files with 34 additions and 48 deletions

View file

@ -0,0 +1,10 @@
namespace Lieb.Models.GuildWars2.Raid
{
public class PlannedRaidRole
{
public int PlannedRaidRoleId { get; set; }
public string Name { get; set; } = String.Empty;
public int Spots { get; }
public string Description { get; set; } = String.Empty;
}
}

View file

@ -0,0 +1,49 @@
namespace Lieb.Models.GuildWars2.Raid
{
public enum RaidType
{
Planned = 1,
RandomWithBoons = 2,
RandomClasses = 3,
RandomEliteSpecialization = 4,
}
public abstract class Raid
{
public int RaidId { get; private set; }
public string Title { get; set; } = String.Empty;
public string Description { get; set; } = String.Empty;
public DateTimeOffset StartTime { get; set; }
public double RaidDuration { get; set; }
public string Organisator { get; set; } = String.Empty;
public string Guild { get; set; } = String.Empty;
public string VoiceChat { get; set; } = String.Empty;
public int Frequency { get; set; }
public RaidType RaidType { get; set; }
//role name, number of spots
public ICollection<PlannedRaidRole> Roles { get; set; } = new HashSet<PlannedRaidRole>();
public ICollection<RaidReminder> Reminders { get; set; } = new List<RaidReminder>();
public ICollection<RaidSignUp> SignUps { get; set; } = new HashSet<RaidSignUp>();
public ICollection<SignUpHistory> SignUpHistory { get; set; } = new HashSet<SignUpHistory>();
//used to edit the Discord message
public ulong DiscordMessageId { get; set; }
public ulong DiscordChannelId { get; set; }
public ulong DiscordGuildId { get; set; }
}
}

View file

@ -0,0 +1,31 @@
namespace Lieb.Models.GuildWars2.Raid
{
public class RaidReminder
{
public enum ReminderType
{
User = 0,
Channel = 1
}
public RaidReminder(ReminderType type, string message, double hoursBeforeRaid, ulong channelId = 0)
{
Type = type;
Message = message;
HoursBeforeRaid = hoursBeforeRaid;
ChannelId = channelId;
}
public int RaidReminderId { get; set; }
public ReminderType Type { get; set; }
public string Message { get; set; }
public double HoursBeforeRaid { get; set; }
public ulong ChannelId { get; set; }
public bool Sent { get; set; } = false;
}
}

View file

@ -0,0 +1,28 @@
namespace Lieb.Models.GuildWars2.Raid
{
public enum SignUpType
{
SignedUp = 0,
Maybe = 1,
Backup = 2,
Flex = 3,
SignedOff = 4
}
public class RaidSignUp
{
public int RaidSignUpId { get; set; }
public int RaidId { get; set; }
public int UserId { get; set; }
public int GuildWars2AccountId { get; set; }
public int PlannedRaidRoleId { get; set; }
public SignUpType SignUpType { get; set; }
public Raid Raid { get; set; }
public LiebUser User { get; set; } = new LiebUser();
public GuildWars2Account GuildWars2Account { get; set; } = new GuildWars2Account();
public PlannedRaidRole PlannedRaidRole { get; set; } = new PlannedRaidRole();
}
}

View file

@ -0,0 +1,15 @@
namespace Lieb.Models.GuildWars2.Raid
{
public class SignUpHistory
{
public int SignUpHistoryId { get; set; }
public string UserName { get; set; } = string.Empty;
public DateTimeOffset Time { get; set; } = DateTimeOffset.Now;
public SignUpType SignUpType { get; set; }
public Raid Raid { get; set; }
}
}