Socket classes for Hermes
This commit is contained in:
27
Quests/Tasks/EmoteMessageQuestTask.cs
Normal file
27
Quests/Tasks/EmoteMessageQuestTask.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace HermesSocketLibrary.Quests.Tasks
|
||||
{
|
||||
public class EmoteMessageQuestTask : IQuestTask
|
||||
{
|
||||
public string Name => $"send {Target} messages";
|
||||
public QuestType Type { get; set; }
|
||||
public int Target { get; }
|
||||
|
||||
public EmoteMessageQuestTask(int target)
|
||||
{
|
||||
Target = target;
|
||||
}
|
||||
|
||||
public bool IsCompleted(int counter)
|
||||
{
|
||||
return counter >= Target;
|
||||
}
|
||||
|
||||
public bool Process(long chatterId, string message, HashSet<string> emotes)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(message))
|
||||
return false;
|
||||
|
||||
return emotes.Count > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
30
Quests/Tasks/MessageQuestTask.cs
Normal file
30
Quests/Tasks/MessageQuestTask.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
namespace HermesSocketLibrary.Quests.Tasks
|
||||
{
|
||||
public class MessageQuestTask : IQuestTask
|
||||
{
|
||||
public string Name => $"send {Target} messages";
|
||||
public QuestType Type { get; set; }
|
||||
public int Target { get; }
|
||||
|
||||
public MessageQuestTask(int target)
|
||||
{
|
||||
Target = target;
|
||||
}
|
||||
|
||||
public bool IsCompleted(int counter)
|
||||
{
|
||||
return counter >= Target;
|
||||
}
|
||||
|
||||
public bool Process(long chatterId, string message, HashSet<string> emotes)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(message))
|
||||
return false;
|
||||
|
||||
if (message.Length < 3)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Quests/Tasks/QuestTask.cs
Normal file
11
Quests/Tasks/QuestTask.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace HermesSocketLibrary.Quests
|
||||
{
|
||||
public interface IQuestTask
|
||||
{
|
||||
public string Name { get; }
|
||||
public QuestType Type { get; set; }
|
||||
public int Target { get; }
|
||||
public abstract bool Process(long chatterId, string message, HashSet<string> emotes);
|
||||
public abstract bool IsCompleted(int counter);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user