diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2020-04-11 19:59:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-11 19:59:43 +0200 |
commit | 5cc06e4748a82acb36310fee89e72f30b2b35a36 (patch) | |
tree | bf99c5498f491c831c8494c064f2be5502f4bdf0 /src/pathfinder.h | |
parent | 5146086a64d5eeb480948d612a008a2ec81455d4 (diff) | |
download | hax-minetest-server-5cc06e4748a82acb36310fee89e72f30b2b35a36.tar.gz hax-minetest-server-5cc06e4748a82acb36310fee89e72f30b2b35a36.zip |
Reduce ServerEnvironment propagation (#9642)
ServerEnvironment is a huge class with many accessors. In various places it's not needed
Remove it to reduce the ServerEnvironment view.
Idea here is to reduce size of some of our objects to transport lightweight managers and permit easier testing
Pathfinder is now tied to a generic map, not a ServerMap, it can be
ported to client
Diffstat (limited to 'src/pathfinder.h')
-rw-r--r-- | src/pathfinder.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/pathfinder.h b/src/pathfinder.h index 70f3d6bbc..526aa0ee8 100644 --- a/src/pathfinder.h +++ b/src/pathfinder.h @@ -29,7 +29,8 @@ with this program; if not, write to the Free Software Foundation, Inc., /* Forward declarations */ /******************************************************************************/ -class ServerEnvironment; +class NodeDefManager; +class Map; /******************************************************************************/ /* Typedefs and macros */ @@ -54,10 +55,10 @@ typedef enum { /******************************************************************************/ /** c wrapper function to use from scriptapi */ -std::vector<v3s16> get_path(ServerEnvironment *env, - v3s16 source, - v3s16 destination, - unsigned int searchdistance, - unsigned int max_jump, - unsigned int max_drop, - PathAlgorithm algo); +std::vector<v3s16> get_path(Map *map, const NodeDefManager *ndef, + v3s16 source, + v3s16 destination, + unsigned int searchdistance, + unsigned int max_jump, + unsigned int max_drop, + PathAlgorithm algo); |