feat: add hero target

This commit is contained in:
k0t9i
2023-01-31 17:35:18 +04:00
parent d2b20e0666
commit bd50473bfb
9 changed files with 261 additions and 60 deletions

View File

@@ -9,7 +9,7 @@ using System.Threading.Tasks;
namespace Client.Domain.Service
{
public class PlayerHandler : EntityHandler<Player>
public class PlayerHandler : EntityHandler<Player>, EventHandlerInterface<TargetChangedEvent>
{
public override void OnCreate(Player entity)
{
@@ -25,6 +25,16 @@ namespace Client.Domain.Service
this.eventBus = eventBus;
}
public void Handle(TargetChangedEvent @event)
{
var target = GetEntity(@event.Hero.TargetId);
if (target == null)
{
return;
}
@event.Hero.Target = target;
}
private readonly EventBusInterface eventBus;
}
}