Socket classes for Hermes

This commit is contained in:
Tom
2024-06-24 22:31:45 +00:00
commit d8522584c4
26 changed files with 434 additions and 0 deletions

42
Quests/Quest.cs Normal file
View File

@@ -0,0 +1,42 @@
namespace HermesSocketLibrary.Quests
{
public abstract class Quest
{
public short Id { get; }
public IQuestTask Task { get; }
public DateTime StartTime { get; }
public DateTime EndTime { get; }
public QuestType Type { get; protected set; }
public int Rewards { get; }
public Quest(short id, IQuestTask task, int rewards, DateTime start, DateTime end)
{
Id = id;
Task = task;
Rewards = rewards;
StartTime = start;
EndTime = end;
}
public bool IsDaily()
{
return Type.HasFlag(QuestType.Daily);
}
public bool IsWeekly()
{
return Type.HasFlag(QuestType.Weekly);
}
public bool IsMonthly()
{
return Type.HasFlag(QuestType.Monthly);
}
public bool IsOngoing()
{
var now = DateTime.UtcNow;
return now >= StartTime && now <= EndTime;
}
}
}