Renamed RaidRole and RaidSignUpHistory

This commit is contained in:
t.ruspekhofer 2022-03-23 21:48:29 +01:00
parent 2bf630f3a1
commit bae69648d0
15 changed files with 144 additions and 121 deletions

View file

@ -24,46 +24,12 @@ namespace Lieb.Models.GuildWars2.Raid
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 ICollection<RaidSignUpHistory> SignUpHistory { get; set; } = new HashSet<RaidSignUpHistory>();
public Raid() { }
public Raid(RaidTemplate template)
public Raid(RaidTemplate template) : base(template)
{
this.Title = template.Title;
this.Description = template.Description;
this.Organizer = template.Organizer;
this.Guild = template.Guild;
this.VoiceChat = template.VoiceChat;
this.RaidType = template.RaidType;
this.RequiredRole = template.RequiredRole;
this.DiscordChannelId = template.DiscordChannelId;
this.DiscordGuildId = template.DiscordGuildId;
foreach(PlannedRaidRole role in template.Roles)
{
this.Roles.Add(new PlannedRaidRole()
{
Description = role.Description,
Name = role.Name,
Spots = role.Spots
});
}
foreach(RaidReminder reminder in template.Reminders)
{
this.Reminders.Add(new RaidReminder()
{
ChannelId = reminder.ChannelId,
HoursBeforeRaid = reminder.HoursBeforeRaid,
Message = reminder.Message,
Sent = reminder.Sent,
Type = reminder.Type
});
}
TimeZoneInfo timeZone = TimeZoneInfo.FindSystemTimeZoneById(template.TimeZone);
StartTimeUTC = TimeZoneInfo.ConvertTimeToUtc(template.StartTime, timeZone);
EndTimeUTC = TimeZoneInfo.ConvertTimeToUtc(template.EndTime, timeZone);