feat: add skills

This commit is contained in:
k0t9i
2023-02-01 00:30:20 +04:00
parent 823241ef32
commit 32fdef9b1c
13 changed files with 310 additions and 14 deletions

View File

@@ -45,8 +45,7 @@ namespace Client.Domain.Service
public T? GetEntity(uint id)
{
T? result = null;
T? result;
entities.TryGetValue(id, out result);
return result;

View File

@@ -0,0 +1,30 @@
using Client.Domain.Entities;
using Client.Domain.Events;
using Client.Domain.Factories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Client.Domain.Service
{
public class SkillHandler : EntityHandler<Skill>
{
public override void OnCreate(Skill entity)
{
eventBus.Publish(new SkillCreatedEvent(entity));
}
public override void OnDelete(Skill entity)
{
eventBus.Publish(new SkillDeletedEvent(entity.Id));
}
public SkillHandler(EntityFactoryInterface<Skill> factory, EventBusInterface eventBus) : base(factory)
{
this.eventBus = eventBus;
}
private readonly EventBusInterface eventBus;
}
}