feat: add hero target
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user