-
Notifications
You must be signed in to change notification settings - Fork 16
/
NPCInteractionController.cs
41 lines (36 loc) · 1.13 KB
/
NPCInteractionController.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
using AutomaticTypeMapper;
using EOLib.Domain.Interact;
using EOLib.Domain.NPC;
using EOLib.IO.Repositories;
namespace EndlessClient.Controllers
{
[AutoMappedType]
public class NPCInteractionController : INPCInteractionController
{
private readonly IMapNPCActions _mapNpcActions;
private readonly IENFFileProvider _enfFileProvider;
public NPCInteractionController(IMapNPCActions mapNpcActions,
IENFFileProvider enfFileProvider)
{
_mapNpcActions = mapNpcActions;
_enfFileProvider = enfFileProvider;
}
public void ShowNPCDialog(INPC npc)
{
var data = _enfFileProvider.ENFFile[npc.ID];
switch(data.Type)
{
case EOLib.IO.NPCType.Shop:
_mapNpcActions.RequestShop(npc);
break;
case EOLib.IO.NPCType.Quest:
_mapNpcActions.RequestQuest(npc);
break;
}
}
}
public interface INPCInteractionController
{
void ShowNPCDialog(INPC npc);
}
}