Class MapleFootholdTree
java.lang.Object
server.maps.MapleFootholdTree
以四叉樹(quadtree)儲存地圖所有
MapleFoothold 的空間索引結構。
最大深度為 maxDepth(8 層),在 insert 時依地形線段的座標範圍
遞迴分配至西北(nw)、東北(ne)、西南(sw)、東南(se)四個子樹,
超出子象限邊界的線段存放於當前節點的 footholds 清單。
對外提供下列核心查詢方法:
findBelow(Point)— 取得指定坐標正下方最近的地形。findBelow(Point, boolean)— 同上,支援飛行判定。findWall(Point, Point)— 在水平範圍內搜尋垂直牆壁。xMatches/yMatches— 取得橫/縱軸範圍內相關的地形清單, 並在座標超出地圖邊界時回退至最外圍地形。calcY(MapleFoothold, Point)— 依平台類型(水平、斜面、垂直)計算精確 y 值。
maxDropX 與 minDropX 供道具掉落邊界計算使用。
由 MapleMapFactory 在解析 WZ 地形資料時填入,並存放於 MapleMap 中。-
Constructor Summary
ConstructorsConstructorDescriptionMapleFootholdTree(Point p1, Point p2) MapleFootholdTree(Point p1, Point p2, int depth) -
Method Summary
Modifier and TypeMethodDescriptionstatic final intcalcY(MapleFoothold fh, Point p) final booleancheckRelevantFH(short fromx, short fromy, short tox, short toy) final MapleFootholdfinal MapleFootholdfinal MapleFootholdfinal List<MapleFoothold> final intfinal intfinal intgetX1()final intgetX2()final intgetY1()final intgetY2()final voidfinal List<MapleFoothold> final List<MapleFoothold>
-
Constructor Details
-
MapleFootholdTree
-
MapleFootholdTree
-
-
Method Details
-
insert
-
getAllRelevants
-
findWall
-
checkRelevantFH
public final boolean checkRelevantFH(short fromx, short fromy, short tox, short toy) -
findBelow
-
getX1
public final int getX1() -
getX2
public final int getX2() -
getY1
public final int getY1() -
getY2
public final int getY2() -
getMaxDropX
public final int getMaxDropX() -
getMinDropX
public final int getMinDropX() -
xMatches
-
yMatches
-
calcY
-
findBelow
-