feat: add view models for all entities
This commit is contained in:
30
Client/Domain/Service/NpcHandler.cs
Normal file
30
Client/Domain/Service/NpcHandler.cs
Normal file
@ -0,0 +1,30 @@
|
||||
using Client.Domain.Entities;
|
||||
using Client.Domain.Factories;
|
||||
using Client.Domain.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Client.Domain.Service
|
||||
{
|
||||
public class NpcHandler : EntityHandler<NPC>
|
||||
{
|
||||
public override void OnCreate(NPC entity)
|
||||
{
|
||||
mainViewModel.AddNpc(entity);
|
||||
}
|
||||
public override void OnDelete(NPC entity)
|
||||
{
|
||||
mainViewModel.RemoveNpc(entity);
|
||||
}
|
||||
|
||||
public NpcHandler(EntityFactoryInterface<NPC> factory, MainViewModelInterface mainViewModel) : base(factory)
|
||||
{
|
||||
this.mainViewModel = mainViewModel;
|
||||
}
|
||||
|
||||
private readonly MainViewModelInterface mainViewModel;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user