summaryrefslogtreecommitdiff
path: root/src/map/map.h
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-07-26 09:59:30 -0300
committershennetsind <ind@henn.et>2013-07-26 09:59:30 -0300
commitb23563de5f9abde73600f84aff1d24d9f3b53bc5 (patch)
tree21ed35a07c74c224957b888b12e387cdd3751561 /src/map/map.h
parent583272234fc96da7911029cd3cad13a7fb386e9e (diff)
parente9e8914ebfa70c1c212d0a7d7173b6da9e0e5b60 (diff)
downloadhercules-b23563de5f9abde73600f84aff1d24d9f3b53bc5.tar.gz
hercules-b23563de5f9abde73600f84aff1d24d9f3b53bc5.tar.bz2
hercules-b23563de5f9abde73600f84aff1d24d9f3b53bc5.tar.xz
hercules-b23563de5f9abde73600f84aff1d24d9f3b53bc5.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map/map.h')
-rw-r--r--src/map/map.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/map/map.h b/src/map/map.h
index 7826e00b3..4bee9c8ea 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -546,8 +546,19 @@ struct map_data {
char name[MAP_NAME_LENGTH];
uint16 index; // The map index used by the mapindex* functions.
struct mapcell* cell; // Holds the information of each map cell (NULL if the map is not on this map-server).
- struct block_list **block;
- struct block_list **block_mob;
+
+ /* 2D Orthogonal Range Search: Grid Implementation
+ "Algorithms in Java, Parts 1-4" 3.18, Robert Sedgewick
+ Map is divided into squares, called blocks (side length = BLOCK_SIZE).
+ For each block there is a linked list of objects in that block (block_list).
+ Array provides capability to access immediately the set of objects close
+ to a given object.
+ The linked lists provide the flexibility to store the objects without
+ knowing ahead how many objects fall into each block.
+ */
+ struct block_list **block; // Grid array of block_lists containing only non-BL_MOB objects
+ struct block_list **block_mob; // Grid array of block_lists containing only BL_MOB objects
+
int16 m;
int16 xs,ys; // map dimensions (in cells)
int16 bxs,bys; // map dimensions (in blocks)