feat: add pathfinding

This commit is contained in:
k0t9i
2023-10-29 20:55:36 +04:00
parent efffe8a7cb
commit 17a4f82f24
20 changed files with 577 additions and 48 deletions

View File

@@ -27,6 +27,8 @@ namespace Client.Domain.Service
EventHandlerInterface<ItemCreatedEvent>,
EventHandlerInterface<ItemDeletedEvent>
{
public Hero? Hero => hero;
public void RequestMoveToLocation(Vector3 location)
{
if (hero == null)
@@ -37,24 +39,6 @@ namespace Client.Domain.Service
SendMessage(OutgoingMessageTypeEnum.Move, location);
}
public void RequestMoveToEntity(uint id)
{
if (hero == null)
{
return;
}
if (!creatures.ContainsKey(id) && !drops.ContainsKey(id))
{
Debug.WriteLine("RequestMoveToEntity: entity " + id + " not found");
return;
}
var position = creatures.ContainsKey(id) ? creatures[id].Transform.Position : drops[id].Transform.Position;
RequestMoveToLocation(position);
}
public void RequestAcquireTarget(uint id)
{
if (hero == null)