-
Notifications
You must be signed in to change notification settings - Fork 16
/
QuestDataRepository.cs
57 lines (41 loc) · 1.53 KB
/
QuestDataRepository.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using AutomaticTypeMapper;
using EOLib.Domain.NPC;
using Optional;
using System.Collections.Generic;
namespace EOLib.Domain.Interact.Quest
{
public interface IQuestDataRepository : IResettable
{
INPC RequestedNPC { get; set; }
Option<IQuestDialogData> QuestDialogData { get; set; }
List<IQuestProgressData> QuestProgress { get; set; }
List<string> QuestHistory { get; set; }
}
public interface IQuestDataProvider : IResettable
{
INPC RequestedNPC { get; }
Option<IQuestDialogData> QuestDialogData { get; }
IReadOnlyList<IQuestProgressData> QuestProgress { get; }
IReadOnlyList<string> QuestHistory { get; }
}
[AutoMappedType(IsSingleton = true)]
public class QuestDataRepository : IQuestDataProvider, IQuestDataRepository
{
public INPC RequestedNPC { get; set; }
public Option<IQuestDialogData> QuestDialogData { get; set; }
public List<IQuestProgressData> QuestProgress { get; set; }
public List<string> QuestHistory { get; set; }
IReadOnlyList<IQuestProgressData> IQuestDataProvider.QuestProgress => QuestProgress;
IReadOnlyList<string> IQuestDataProvider.QuestHistory => QuestHistory;
public QuestDataRepository()
{
ResetState();
}
public void ResetState()
{
QuestDialogData = Option.None<IQuestDialogData>();
QuestProgress = new List<IQuestProgressData>();
QuestHistory = new List<string>();
}
}
}