Class MapleFoothold

java.lang.Object
server.maps.MapleFoothold
All Implemented Interfaces:
Comparable<MapleFoothold>

public class MapleFoothold extends Object implements Comparable<MapleFoothold>
地圖地形單元(foothold),代表一條線段形式的可站立平台或牆壁。

由兩個端點(p1p2)與唯一識別碼(id)構成, 另有前後連結索引(prevnext)以形成地形鏈結串列。 isWall() 判斷兩端 x 座標相同(垂直線段)、 isFlat() 判斷兩端 y 座標相同(水平線段)、 isSlope() 判斷兩端 y 座標不同(斜面)。 compareTo 依 y 範圍排序,供 MapleFootholdTree 在二維樹結構中 進行高效率的落點查詢(findBelow)。 本類別從 MapleDataTool 解析 WZ 地形資料後建立, 並儲存於 MapleFootholdTree 中。

  • Constructor Details

    • MapleFoothold

      public MapleFoothold(Point p1, Point p2, int id)
  • Method Details

    • isWall

      public boolean isWall()
    • isFlat

      public boolean isFlat()
    • isSlope

      public boolean isSlope()
    • getPoint1

      public Point getPoint1()
    • getPoint2

      public Point getPoint2()
    • getX1

      public int getX1()
    • getX2

      public int getX2()
    • getY1

      public int getY1()
    • getY2

      public int getY2()
    • compareTo

      public int compareTo(MapleFoothold o)
      Specified by:
      compareTo in interface Comparable<MapleFoothold>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getId

      public int getId()
    • getNext

      public short getNext()
    • setNext

      public void setNext(short next)
    • getPrev

      public short getPrev()
    • setPrev

      public void setPrev(short prev)