Lieb-Website/Shared/Models/GuildWars2/Raid/Raid.cs
2022-04-02 19:23:53 +02:00

40 lines
1.2 KiB
C#

using System.ComponentModel.DataAnnotations;
namespace Lieb.Models.GuildWars2.Raid
{
public enum RaidType
{
Planned = 0,
RandomWithBoons = 1,
RandomClasses = 2,
RandomEliteSpecialization = 3,
}
public class Raid : RaidBase
{
public int RaidId { get; private set; }
[Required]
public DateTimeOffset StartTimeUTC { get; set; } = DateTime.Now;
[Required]
public DateTimeOffset EndTimeUTC { get; set; }
public DateTimeOffset FreeForAllTimeUTC { get; set; }
public ICollection<RaidSignUp> SignUps { get; set; } = new HashSet<RaidSignUp>();
public ICollection<RaidSignUpHistory> SignUpHistory { get; set; } = new HashSet<RaidSignUpHistory>();
public Raid() { }
public Raid(RaidTemplate template) : base(template)
{
TimeZoneInfo timeZone = TimeZoneInfo.FindSystemTimeZoneById(template.TimeZone);
StartTimeUTC = TimeZoneInfo.ConvertTimeToUtc(template.StartTime, timeZone);
EndTimeUTC = TimeZoneInfo.ConvertTimeToUtc(template.EndTime, timeZone);
FreeForAllTimeUTC = TimeZoneInfo.ConvertTimeToUtc(template.FreeForAllTime, timeZone);
}
}
}