diff --git a/server/gameserver/mapservice.cc b/server/gameserver/mapservice.cc index 76c4e29..7b7f5cf 100644 --- a/server/gameserver/mapservice.cc +++ b/server/gameserver/mapservice.cc @@ -230,3 +230,21 @@ int MapService::GetGridId(float world_x, float world_y) int grid_id = (int)(world_x/cell_width_) + (int)(world_y/cell_width_) * map_width_; return grid_id; } + +int MapService::FindPathRequest(Human* hum, + const a8::Vec2& start_pos, + const a8::Vec2& end_pos, + int max_step_num) +{ + return 0; +} + +FindPathStatus* MapService::QueryFindPathStatus(int query_id) +{ + return nullptr; +} + +void MapService::RemoveFindPathRequest(Human* hum, int query_id) +{ + +} diff --git a/server/gameserver/mapservice.h b/server/gameserver/mapservice.h index a8b1297..c30ce69 100644 --- a/server/gameserver/mapservice.h +++ b/server/gameserver/mapservice.h @@ -1,5 +1,6 @@ #pragma once +class Human; class ColliderComponent; struct CellNode @@ -9,6 +10,23 @@ struct CellNode CellNode* next = nullptr; }; +struct MovePathPoint +{ + a8::Vec2 pos; + float distance = 0; +}; + +struct FindPathStatus +{ + long long frameno = 0; + Human* hum = nullptr; + a8::Vec2 start_pos; + a8::Vec2 end_pos; + int curr_step = 0; + int max_step_num = 0; + std::vector out_ponits; +}; + class Room; class MapService { @@ -25,6 +43,12 @@ class MapService float world_x, float world_y, std::set& colliders); + int FindPathRequest(Human* hum, + const a8::Vec2& start_pos, + const a8::Vec2& end_pos, + int max_step_num); + FindPathStatus* QueryFindPathStatus(int query_id); + void RemoveFindPathRequest(Human* hum, int query_id); private: int GetGridId(float world_x, float world_y);