RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.game.world.pathfinding.TraversalMap Class Reference

Contains traversal data for a set of regions. More...

Static Public Member Functions

static void block (Region region, int height, int localX, int localY)
 Marks the specified set of coordinates blocked, unable to be passed through.
static boolean blockedEast (Position position)
static boolean blockedNorth (Position position)
static boolean blockedSouth (Position position)
static boolean blockedWest (Position position)
static int getFlags (int x, int y, int height)
static int getFlags (Position position)
static Position getRandomNonDiagonal (Position from)
static Position getRandomTraversableTile (Position southWest, int width, int length)
static List< PositiongetTraversableTiles (Position southWest, int width, int length)
 Returns a List of positions that are traversable from the specified position.
static boolean isTraversable (Position from, Direction direction, boolean impenetrable)
 Tests whether or not a specified position is traversable in the specified direction.
static boolean isTraversable (Position from, Direction direction, int size)
 Tests whether or not a specified position is traversable in the specified direction.
static void markBridge (Region region, int height, int x, int y)
 Marks the specified coordinates a bridge.
static void markObject (Region region, GameObject object, boolean add, boolean list)
 Marks a GameObject with the specified attributes on the specified Position to the TraversalMap.
static void markOccupant (Region region, int height, int x, int y, int width, int length, boolean impenetrable, boolean add)
 Marks the specified coordinates occupied by some object.
static void set (Region region, int height, int x, int y, int flag)
 Sets a flag on the specified position.

Private Member Functions

 TraversalMap ()

Static Private Member Functions

static boolean isInactive (int height, int x, int y, int flag)
 Checks whether or not the specified flag is not active on the specified position.
static boolean isTraversableEast (int height, int x, int y)
 Tests if the specified position can be traversed east.
static boolean isTraversableEast (int height, int x, int y, boolean impenetrable)
 Tests if the specified position can be traversed east.
static boolean isTraversableEast (int height, int x, int y, int size)
 Tests if the specified position can be traversed east.
static boolean isTraversableNorth (int height, int x, int y)
 Tests if the specified position can be traversed north.
static boolean isTraversableNorth (int height, int x, int y, boolean impenetrable)
 Tests if the specified position can be traversed north.
static boolean isTraversableNorth (int height, int x, int y, int size)
 Tests if the specified position can be traversed north.
static boolean isTraversableNorthEast (int height, int x, int y)
 Tests if the specified position can be traversed north east.
static boolean isTraversableNorthEast (int height, int x, int y, boolean impenetrable)
 Tests if the specified position can be traversed north east.
static boolean isTraversableNorthEast (int height, int x, int y, int size)
 Tests if the specified position can be traversed north east.
static boolean isTraversableNorthWest (int height, int x, int y)
 Tests if the specified position can be traversed north west.
static boolean isTraversableNorthWest (int height, int x, int y, boolean impenetrable)
 Tests if the specified position can be traversed north west.
static boolean isTraversableNorthWest (int height, int x, int y, int size)
 Tests if the specified position can be traversed north west.
static boolean isTraversableSouth (int height, int x, int y)
 Tests if the specified position can be traversed south.
static boolean isTraversableSouth (int height, int x, int y, boolean impenetrable)
 Tests if the specified position can be traversed south.
static boolean isTraversableSouth (int height, int x, int y, int size)
 Tests if the specified position can be traversed south.
static boolean isTraversableSouthEast (int height, int x, int y)
 Tests if the specified position can be traversed south east.
static boolean isTraversableSouthEast (int height, int x, int y, boolean impenetrable)
 Tests if the specified position can be traversed south east.
static boolean isTraversableSouthEast (int height, int x, int y, int size)
 Tests if the specified position can be traversed south east.
static boolean isTraversableSouthWest (int height, int x, int y)
 Tests if the specified position can be traversed south west.
static boolean isTraversableSouthWest (int height, int x, int y, boolean impenetrable)
 Tests if the specified position can be traversed south west.
static boolean isTraversableSouthWest (int height, int x, int y, int size)
 Tests if the specified position can be traversed south west.
static boolean isTraversableWest (int height, int x, int y)
 Tests if the specified position can be traversed west.
static boolean isTraversableWest (int height, int x, int y, boolean impenetrable)
 Tests if the specified position can be traversed west.
static boolean isTraversableWest (int height, int x, int y, int size)
 Tests if the specified position can be traversed west.
static void markWall (Region reg, ObjectDirection orientation, int height, int x, int y, ObjectType type, boolean impenetrable)
 Informs the region of an existing wall.
static void unmarkWall (Region reg, ObjectDirection orientation, int height, int x, int y, ObjectType type, boolean impenetrable)
 Informs the region of an existing wall being removed.
static void unset (Region region, int height, int x, int y, int flag)
 Unsets the specified flag from the specified position.

Detailed Description

Contains traversal data for a set of regions.

Author
Artem Batutin artem.nosp@m.batu.nosp@m.tin@g.nosp@m.mail.nosp@m..com
Ryley Kimmel ryley.nosp@m..kim.nosp@m.mel@l.nosp@m.ive..nosp@m.com

Definition at line 24 of file TraversalMap.java.

Constructor & Destructor Documentation

◆ TraversalMap()

com.runehive.game.world.pathfinding.TraversalMap.TraversalMap ( )
private

Definition at line 26 of file TraversalMap.java.

26{}

Member Function Documentation

◆ block()

void com.runehive.game.world.pathfinding.TraversalMap.block ( Region region,
int height,
int localX,
int localY )
static

Marks the specified set of coordinates blocked, unable to be passed through.

Parameters
heightThe height.
localXThe x coordinate.
localYThe y coordinate.

Definition at line 352 of file TraversalMap.java.

352 {
353 region.setFlags(height, localX, localY, TraversalConstants.BLOCKED);
354 }

References com.runehive.game.world.pathfinding.TraversalConstants.BLOCKED.

Referenced by com.runehive.fs.cache.decoder.RegionDecoder.parseTerrain().

Here is the caller graph for this function:

◆ blockedEast()

boolean com.runehive.game.world.pathfinding.TraversalMap.blockedEast ( Position position)
static

Definition at line 1027 of file TraversalMap.java.

1027 {
1028 return !isTraversableEast(position.getHeight(), position.getX(), position.getY(), false);
1029 }

References isTraversableEast().

Referenced by com.runehive.game.world.region.Region.reachable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ blockedNorth()

boolean com.runehive.game.world.pathfinding.TraversalMap.blockedNorth ( Position position)
static

Definition at line 1023 of file TraversalMap.java.

1023 {
1024 return !isTraversableNorth(position.getHeight(), position.getX(), position.getY(), false);
1025 }

References isTraversableNorth().

Referenced by com.runehive.game.world.region.Region.reachable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ blockedSouth()

boolean com.runehive.game.world.pathfinding.TraversalMap.blockedSouth ( Position position)
static

Definition at line 1031 of file TraversalMap.java.

1031 {
1032 return !isTraversableSouth(position.getHeight(), position.getX(), position.getY(), false);
1033 }

References isTraversableSouth().

Referenced by com.runehive.game.world.region.Region.reachable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ blockedWest()

boolean com.runehive.game.world.pathfinding.TraversalMap.blockedWest ( Position position)
static

Definition at line 1035 of file TraversalMap.java.

1035 {
1036 return !isTraversableWest(position.getHeight(), position.getX(), position.getY(), false);
1037 }

References isTraversableWest().

Referenced by com.runehive.game.world.region.Region.reachable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFlags() [1/2]

int com.runehive.game.world.pathfinding.TraversalMap.getFlags ( int x,
int y,
int height )
static

Definition at line 1012 of file TraversalMap.java.

1012 {
1013 int localX = x & 0x3F;
1014 int localY = y & 0x3F;
1015 Region region = World.getRegions().getRegion(x, y);
1016 return region.getFlags(height, localX, localY);
1017 }

References com.runehive.game.world.region.RegionManager.getRegion(), and com.runehive.game.world.World.getRegions().

Referenced by getFlags(), and com.runehive.game.world.entity.mob.movement.waypoint.Waypoint.withinDistance().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFlags() [2/2]

int com.runehive.game.world.pathfinding.TraversalMap.getFlags ( Position position)
static

Definition at line 1019 of file TraversalMap.java.

1019 {
1020 return getFlags(position.getX(), position.getY(), position.getHeight());
1021 }

References getFlags().

Here is the call graph for this function:

◆ getRandomNonDiagonal()

Position com.runehive.game.world.pathfinding.TraversalMap.getRandomNonDiagonal ( Position from)
static

Definition at line 991 of file TraversalMap.java.

991 {
992 List<Position> positions = new LinkedList<>();
993
994 if (isTraversableNorth(from.getHeight(), from.getX(), from.getY()))
995 positions.add(from.north());
996
997 if (isTraversableSouth(from.getHeight(), from.getX(), from.getY()))
998 positions.add(from.south());
999
1000 if (isTraversableEast(from.getHeight(), from.getX(), from.getY()))
1001 positions.add(from.east());
1002
1003 if (isTraversableWest(from.getHeight(), from.getX(), from.getY()))
1004 positions.add(from.west());
1005
1006 if (positions.isEmpty())
1007 return null;
1008
1009 return RandomUtils.random(positions);
1010 }

References com.runehive.game.world.position.Position.east(), com.runehive.game.world.position.Position.getHeight(), com.runehive.game.world.position.Position.getX(), com.runehive.game.world.position.Position.getY(), isTraversableEast(), isTraversableNorth(), isTraversableSouth(), isTraversableWest(), com.runehive.game.world.position.Position.north(), com.runehive.util.RandomUtils.random(), com.runehive.game.world.position.Position.south(), and com.runehive.game.world.position.Position.west().

Referenced by com.runehive.content.activity.impl.duelarena.DuelArenaActivity.start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRandomTraversableTile()

Position com.runehive.game.world.pathfinding.TraversalMap.getRandomTraversableTile ( Position southWest,
int width,
int length )
static

Definition at line 955 of file TraversalMap.java.

955 {
956 List<Position> positions = new LinkedList<>();
957 for (int y = 0; y < length; y++) {
958 for (int x = 0; x < width; x++) {
959 Position from = southWest.transform(x, y);
960
961 if (isTraversableNorth(from.getHeight(), from.getX(), from.getY()))
962 positions.add(from.north());
963
964 if (isTraversableSouth(from.getHeight(), from.getX(), from.getY()))
965 positions.add(from.south());
966
967 if (isTraversableEast(from.getHeight(), from.getX(), from.getY()))
968 positions.add(from.east());
969
970 if (isTraversableWest(from.getHeight(), from.getX(), from.getY()))
971 positions.add(from.west());
972
973 if (isTraversableNorthEast(from.getHeight(), from.getX(), from.getY()))
974 positions.add(from.northEast());
975
976 if (isTraversableNorthWest(from.getHeight(), from.getX(), from.getY()))
977 positions.add(from.northWest());
978
979 if (isTraversableSouthEast(from.getHeight(), from.getX(), from.getY()))
980 positions.add(from.southEast());
981
982 if (isTraversableSouthWest(from.getHeight(), from.getX(), from.getY()))
983 positions.add(from.southWest());
984 }
985 }
986 if (positions.isEmpty())
987 return null;
988 return RandomUtils.random(positions);
989 }

References com.runehive.game.world.position.Position.east(), com.runehive.game.world.position.Position.getHeight(), com.runehive.game.world.position.Position.getX(), com.runehive.game.world.position.Position.getY(), isTraversableEast(), isTraversableNorth(), isTraversableNorthEast(), isTraversableNorthWest(), isTraversableSouth(), isTraversableSouthEast(), isTraversableSouthWest(), isTraversableWest(), com.runehive.game.world.position.Position.north(), com.runehive.game.world.position.Position.northEast(), com.runehive.game.world.position.Position.northWest(), com.runehive.util.RandomUtils.random(), com.runehive.game.world.position.Position.south(), com.runehive.game.world.position.Position.southEast(), com.runehive.game.world.position.Position.southWest(), com.runehive.game.world.position.Position.transform(), and com.runehive.game.world.position.Position.west().

Referenced by com.runehive.content.activity.impl.duelarena.DuelArenaActivity.finish(), and com.runehive.content.activity.impl.duelarena.DuelArenaActivity.start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTraversableTiles()

List< Position > com.runehive.game.world.pathfinding.TraversalMap.getTraversableTiles ( Position southWest,
int width,
int length )
static

Returns a List of positions that are traversable from the specified position.

Parameters
southWestThe position moving from.
widthThe size of the mob attempting to traverse.
length
Returns
A List of positions.

Definition at line 921 of file TraversalMap.java.

921 {
922 List<Position> positions = new LinkedList<>();
923 for (int y = 0; y < length; y++) {
924 for (int x = 0; x < width; x++) {
925 Position from = southWest.transform(x, y);
926
927 if (isTraversableNorth(from.getHeight(), from.getX(), from.getY()))
928 positions.add(from.north());
929
930 if (isTraversableSouth(from.getHeight(), from.getX(), from.getY()))
931 positions.add(from.south());
932
933 if (isTraversableEast(from.getHeight(), from.getX(), from.getY()))
934 positions.add(from.east());
935
936 if (isTraversableWest(from.getHeight(), from.getX(), from.getY()))
937 positions.add(from.west());
938
939 if (isTraversableNorthEast(from.getHeight(), from.getX(), from.getY()))
940 positions.add(from.northEast());
941
942 if (isTraversableNorthWest(from.getHeight(), from.getX(), from.getY()))
943 positions.add(from.northWest());
944
945 if (isTraversableSouthEast(from.getHeight(), from.getX(), from.getY()))
946 positions.add(from.southEast());
947
948 if (isTraversableSouthWest(from.getHeight(), from.getX(), from.getY()))
949 positions.add(from.southWest());
950 }
951 }
952 return positions;
953 }

References com.runehive.game.world.position.Position.east(), com.runehive.game.world.position.Position.getHeight(), com.runehive.game.world.position.Position.getX(), com.runehive.game.world.position.Position.getY(), isTraversableEast(), isTraversableNorth(), isTraversableNorthEast(), isTraversableNorthWest(), isTraversableSouth(), isTraversableSouthEast(), isTraversableSouthWest(), isTraversableWest(), com.runehive.game.world.position.Position.north(), com.runehive.game.world.position.Position.northEast(), com.runehive.game.world.position.Position.northWest(), com.runehive.game.world.position.Position.south(), com.runehive.game.world.position.Position.southEast(), com.runehive.game.world.position.Position.southWest(), com.runehive.game.world.position.Position.transform(), and com.runehive.game.world.position.Position.west().

Referenced by com.runehive.content.activity.impl.pestcontrol.PestControlGame.spawn(), and com.runehive.game.world.entity.combat.strategy.npc.boss.Vorkath.VenomSpecial.start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInactive()

boolean com.runehive.game.world.pathfinding.TraversalMap.isInactive ( int height,
int x,
int y,
int flag )
staticprivate

Checks whether or not the specified flag is not active on the specified position.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
flagThe flag to check.
Returns
true if the specified flag is not active on the specified position, otherwise false.

Definition at line 823 of file TraversalMap.java.

823 {
824 int localX = x & 0x3F;
825 int localY = y & 0x3F;
826 Region region = World.getRegions().getRegion(x, y);
827 return (region.getFlags(height, localX, localY) & flag) == 0;
828 }

References com.runehive.game.world.region.RegionManager.getRegion(), and com.runehive.game.world.World.getRegions().

Referenced by isTraversableEast(), isTraversableNorth(), isTraversableNorthEast(), isTraversableNorthWest(), isTraversableSouth(), isTraversableSouthEast(), isTraversableSouthWest(), and isTraversableWest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isTraversable() [1/2]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversable ( Position from,
Direction direction,
boolean impenetrable )
static

Tests whether or not a specified position is traversable in the specified direction.

Parameters
fromThe position.
directionThe direction to traverse.
impenetrableThe condition if impenetrability must be checked.
Returns
true if the direction is traversable otherwise false.

Definition at line 887 of file TraversalMap.java.

887 {
888 switch (direction) {
889 case NORTH:
890 return isTraversableNorth(from.getHeight(), from.getX(), from.getY(), impenetrable);
891 case SOUTH:
892 return isTraversableSouth(from.getHeight(), from.getX(), from.getY(), impenetrable);
893 case EAST:
894 return isTraversableEast(from.getHeight(), from.getX(), from.getY(), impenetrable);
895 case WEST:
896 return isTraversableWest(from.getHeight(), from.getX(), from.getY(), impenetrable);
897 case NORTH_EAST:
898 return isTraversableNorthEast(from.getHeight(), from.getX(), from.getY(), impenetrable);
899 case NORTH_WEST:
900 return isTraversableNorthWest(from.getHeight(), from.getX(), from.getY(), impenetrable);
901 case SOUTH_EAST:
902 return isTraversableSouthEast(from.getHeight(), from.getX(), from.getY(), impenetrable);
903 case SOUTH_WEST:
904 return isTraversableSouthWest(from.getHeight(), from.getX(), from.getY(), impenetrable);
905 case NONE:
906 return true;
907 default:
908 throw new IllegalArgumentException("direction: " + direction + " is not valid");
909 }
910 }

References com.runehive.game.world.position.Position.getHeight(), com.runehive.game.world.position.Position.getX(), com.runehive.game.world.position.Position.getY(), isTraversableEast(), isTraversableNorth(), isTraversableNorthEast(), isTraversableNorthWest(), isTraversableSouth(), isTraversableSouthEast(), isTraversableSouthWest(), and isTraversableWest().

Here is the call graph for this function:

◆ isTraversable() [2/2]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversable ( Position from,
Direction direction,
int size )
static

Tests whether or not a specified position is traversable in the specified direction.

Parameters
fromThe position.
directionThe direction to traverse.
sizeThe size of the entity attempting to traverse.
Returns
true if the direction is traversable otherwise false.

Definition at line 852 of file TraversalMap.java.

852 {
853 switch (direction) {
854 case NORTH:
855 return isTraversableNorth(from.getHeight(), from.getX(), from.getY(), size);
856 case SOUTH:
857 return isTraversableSouth(from.getHeight(), from.getX(), from.getY(), size);
858 case EAST:
859 return isTraversableEast(from.getHeight(), from.getX(), from.getY(), size);
860 case WEST:
861 return isTraversableWest(from.getHeight(), from.getX(), from.getY(), size);
862 case NORTH_EAST:
863 return isTraversableNorthEast(from.getHeight(), from.getX(), from.getY(), size);
864 case NORTH_WEST:
865 return isTraversableNorthWest(from.getHeight(), from.getX(), from.getY(), size);
866 case SOUTH_EAST:
867 return isTraversableSouthEast(from.getHeight(), from.getX(), from.getY(), size);
868 case SOUTH_WEST:
869 return isTraversableSouthWest(from.getHeight(), from.getX(), from.getY(), size);
870 case NONE:
871 return false;
872 default:
873 throw new IllegalArgumentException("direction: " + direction + " is not valid");
874 }
875 }

References com.runehive.game.world.position.Position.getHeight(), com.runehive.game.world.position.Position.getX(), com.runehive.game.world.position.Position.getY(), isTraversableEast(), isTraversableNorth(), isTraversableNorthEast(), isTraversableNorthWest(), isTraversableSouth(), isTraversableSouthEast(), isTraversableSouthWest(), and isTraversableWest().

Referenced by com.runehive.game.world.entity.combat.strategy.player.special.melee.DragonSpear.canAttack(), com.runehive.content.gambling.GambleManager.canPlayFlowerPokerAtPositon(), com.runehive.util.Utility.findAccessableTile(), com.runehive.util.Utility.fixInsidePosition(), com.runehive.content.activity.impl.magearena.MageArena.getAvailablePosition(), com.runehive.game.world.pathfinding.path.PathFinder.projectileCheck(), com.runehive.game.world.entity.mob.Mob.takeStep(), com.runehive.game.world.pathfinding.path.PathFinder.traversable(), and com.runehive.game.world.pathfinding.path.PathFinder.traversable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isTraversableEast() [1/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableEast ( int height,
int x,
int y )
staticprivate

Tests if the specified position can be traversed east.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
Returns
true if it is possible to traverse east otherwise false.

Definition at line 524 of file TraversalMap.java.

524 {
525 return isTraversableEast(height, x, y, false);
526 }

References isTraversableEast().

Here is the call graph for this function:

◆ isTraversableEast() [2/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableEast ( int height,
int x,
int y,
boolean impenetrable )
staticprivate

Tests if the specified position can be traversed east.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
impenetrableWhether or not this occupation can be traversed.
Returns
true if it is possible to traverse east otherwise false.

Definition at line 538 of file TraversalMap.java.

538 {
539 if (impenetrable) {
540 return isInactive(height, x + 1, y, TraversalConstants.IMPENETRABLE_BLOCKED | TraversalConstants.IMPENETRABLE_WALL_WEST);
541 }
542 return isInactive(height, x + 1, y, TraversalConstants.WALL_WEST | TraversalConstants.BLOCKED);
543 }

References com.runehive.game.world.pathfinding.TraversalConstants.BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_WEST, isInactive(), and com.runehive.game.world.pathfinding.TraversalConstants.WALL_WEST.

Here is the call graph for this function:

◆ isTraversableEast() [3/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableEast ( int height,
int x,
int y,
int size )
staticprivate

Tests if the specified position can be traversed east.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
sizeThe size of the entity attempting to traverse east.
Returns
true if it is possible to traverse east otherwise false

Definition at line 504 of file TraversalMap.java.

504 {
505 for (int offsetX = 0; offsetX < size; offsetX++) {
506 for (int offsetY = 0; offsetY < size; offsetY++) {
507 if (!isTraversableEast(height, x + offsetX, y + offsetY)) {
508 return false;
509 }
510 }
511 }
512 return true;
513 }

References isTraversableEast().

Referenced by blockedEast(), getRandomNonDiagonal(), getRandomTraversableTile(), getTraversableTiles(), isTraversable(), isTraversable(), isTraversableEast(), and isTraversableEast().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isTraversableNorth() [1/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableNorth ( int height,
int x,
int y )
staticprivate

Tests if the specified position can be traversed north.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
Returns
true if it is possible to traverse north otherwise false.

Definition at line 422 of file TraversalMap.java.

422 {
423 return isTraversableNorth(height, x, y, false);
424 }

References isTraversableNorth().

Here is the call graph for this function:

◆ isTraversableNorth() [2/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableNorth ( int height,
int x,
int y,
boolean impenetrable )
staticprivate

Tests if the specified position can be traversed north.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
impenetrableWhether or not this occupation can be traversed.
Returns
true if it is possible to traverse north otherwise false.

Definition at line 436 of file TraversalMap.java.

436 {
437 if (impenetrable) {
438 return isInactive(height, x, y + 1, TraversalConstants.IMPENETRABLE_BLOCKED | TraversalConstants.IMPENETRABLE_WALL_SOUTH);
439 }
440 return isInactive(height, x, y + 1, TraversalConstants.WALL_SOUTH | TraversalConstants.BLOCKED);
441 }

References com.runehive.game.world.pathfinding.TraversalConstants.BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_SOUTH, isInactive(), and com.runehive.game.world.pathfinding.TraversalConstants.WALL_SOUTH.

Here is the call graph for this function:

◆ isTraversableNorth() [3/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableNorth ( int height,
int x,
int y,
int size )
staticprivate

Tests if the specified position can be traversed north.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
sizeThe size of the entity attempting to traverse north.
Returns
true if it is possible to traverse north otherwise false

Definition at line 402 of file TraversalMap.java.

402 {
403 for (int offsetX = 0; offsetX < size; offsetX++) {
404 for (int offsetY = 0; offsetY < size; offsetY++) {
405 if (!isTraversableNorth(height, x + offsetX, y + offsetY)) {
406 return false;
407 }
408 }
409 }
410 return true;
411 }

References isTraversableNorth().

Referenced by blockedNorth(), getRandomNonDiagonal(), getRandomTraversableTile(), getTraversableTiles(), isTraversable(), isTraversable(), isTraversableNorth(), and isTraversableNorth().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isTraversableNorthEast() [1/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableNorthEast ( int height,
int x,
int y )
staticprivate

Tests if the specified position can be traversed north east.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
Returns
true if it is possible to traverse north east otherwise false.

Definition at line 626 of file TraversalMap.java.

626 {
627 return isTraversableNorthEast(height, x, y, false);
628 }

References isTraversableNorthEast().

Here is the call graph for this function:

◆ isTraversableNorthEast() [2/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableNorthEast ( int height,
int x,
int y,
boolean impenetrable )
staticprivate

Tests if the specified position can be traversed north east.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
impenetrableWhether or not this occupation can be traversed.
Returns
true if it is possible to traverse north east otherwise false.

Definition at line 640 of file TraversalMap.java.

640 {
641 if (impenetrable) {
642 return isInactive(height, x + 1, y + 1, TraversalConstants.IMPENETRABLE_WALL_WEST | TraversalConstants.IMPENETRABLE_WALL_SOUTH | TraversalConstants.IMPENETRABLE_WALL_SOUTH_WEST) && isInactive(height, x + 1, y, TraversalConstants.IMPENETRABLE_WALL_WEST | TraversalConstants.IMPENETRABLE_BLOCKED) && isInactive(height, x, y + 1, TraversalConstants.IMPENETRABLE_WALL_SOUTH | TraversalConstants.IMPENETRABLE_BLOCKED);
643 }
644 return isInactive(height, x + 1, y + 1, TraversalConstants.WALL_WEST | TraversalConstants.WALL_SOUTH | TraversalConstants.WALL_SOUTH_WEST | TraversalConstants.BLOCKED) && isInactive(height, x + 1, y, TraversalConstants.WALL_WEST | TraversalConstants.BLOCKED) && isInactive(height, x, y + 1, TraversalConstants.WALL_SOUTH | TraversalConstants.BLOCKED);
645 }

References com.runehive.game.world.pathfinding.TraversalConstants.BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_SOUTH, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_SOUTH_WEST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_WEST, isInactive(), com.runehive.game.world.pathfinding.TraversalConstants.WALL_SOUTH, com.runehive.game.world.pathfinding.TraversalConstants.WALL_SOUTH_WEST, and com.runehive.game.world.pathfinding.TraversalConstants.WALL_WEST.

Here is the call graph for this function:

◆ isTraversableNorthEast() [3/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableNorthEast ( int height,
int x,
int y,
int size )
staticprivate

Tests if the specified position can be traversed north east.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
sizeThe size of the entity attempting to traverse north east.
Returns
true if it is possible to traverse north east otherwise false

Definition at line 606 of file TraversalMap.java.

606 {
607 for (int offsetX = 0; offsetX < size; offsetX++) {
608 for (int offsetY = 0; offsetY < size; offsetY++) {
609 if (!isTraversableNorthEast(height, x + offsetX, y + offsetY)) {
610 return false;
611 }
612 }
613 }
614 return true;
615 }

References isTraversableNorthEast().

Referenced by getRandomTraversableTile(), getTraversableTiles(), isTraversable(), isTraversable(), isTraversableNorthEast(), and isTraversableNorthEast().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isTraversableNorthWest() [1/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableNorthWest ( int height,
int x,
int y )
staticprivate

Tests if the specified position can be traversed north west.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
Returns
true if it is possible to traverse north west otherwise false.

Definition at line 677 of file TraversalMap.java.

677 {
678 return isTraversableNorthWest(height, x, y, false);
679 }

References isTraversableNorthWest().

Here is the call graph for this function:

◆ isTraversableNorthWest() [2/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableNorthWest ( int height,
int x,
int y,
boolean impenetrable )
staticprivate

Tests if the specified position can be traversed north west.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
impenetrableWhether or not this occupation can be traversed.
Returns
true if it is possible to traverse north west otherwise false.

Definition at line 691 of file TraversalMap.java.

691 {
692 if (impenetrable) {
693 return isInactive(height, x - 1, y + 1, TraversalConstants.IMPENETRABLE_WALL_EAST | TraversalConstants.IMPENETRABLE_WALL_SOUTH | TraversalConstants.IMPENETRABLE_WALL_SOUTH_EAST) && isInactive(height, x - 1, y, TraversalConstants.IMPENETRABLE_WALL_EAST | TraversalConstants.IMPENETRABLE_BLOCKED) && isInactive(height, x, y + 1, TraversalConstants.IMPENETRABLE_WALL_SOUTH | TraversalConstants.IMPENETRABLE_BLOCKED);
694 }
695 return isInactive(height, x - 1, y + 1, TraversalConstants.WALL_EAST | TraversalConstants.WALL_SOUTH | TraversalConstants.WALL_SOUTH_EAST | TraversalConstants.BLOCKED) && isInactive(height, x - 1, y, TraversalConstants.WALL_EAST | TraversalConstants.BLOCKED) && isInactive(height, x, y + 1, TraversalConstants.WALL_SOUTH | TraversalConstants.BLOCKED);
696 }

References com.runehive.game.world.pathfinding.TraversalConstants.BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_EAST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_SOUTH, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_SOUTH_EAST, isInactive(), com.runehive.game.world.pathfinding.TraversalConstants.WALL_EAST, com.runehive.game.world.pathfinding.TraversalConstants.WALL_SOUTH, and com.runehive.game.world.pathfinding.TraversalConstants.WALL_SOUTH_EAST.

Here is the call graph for this function:

◆ isTraversableNorthWest() [3/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableNorthWest ( int height,
int x,
int y,
int size )
staticprivate

Tests if the specified position can be traversed north west.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
sizeThe size of the entity attempting to traverse north west.
Returns
true if it is possible to traverse north west otherwise false

Definition at line 657 of file TraversalMap.java.

657 {
658 for (int offsetX = 0; offsetX < size; offsetX++) {
659 for (int offsetY = 0; offsetY < size; offsetY++) {
660 if (!isTraversableNorthWest(height, x + offsetX, y + offsetY)) {
661 return false;
662 }
663 }
664 }
665 return true;
666 }

References isTraversableNorthWest().

Referenced by getRandomTraversableTile(), getTraversableTiles(), isTraversable(), isTraversable(), isTraversableNorthWest(), and isTraversableNorthWest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isTraversableSouth() [1/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableSouth ( int height,
int x,
int y )
staticprivate

Tests if the specified position can be traversed south.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
Returns
true if it is possible to traverse south otherwise false.

Definition at line 473 of file TraversalMap.java.

473 {
474 return isTraversableSouth(height, x, y, false);
475 }

References isTraversableSouth().

Here is the call graph for this function:

◆ isTraversableSouth() [2/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableSouth ( int height,
int x,
int y,
boolean impenetrable )
staticprivate

Tests if the specified position can be traversed south.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
impenetrableWhether or not this occupation can be traversed.
Returns
true if it is possible to traverse south otherwise false.

Definition at line 487 of file TraversalMap.java.

487 {
488 if (impenetrable) {
489 return isInactive(height, x, y - 1, TraversalConstants.IMPENETRABLE_BLOCKED | TraversalConstants.IMPENETRABLE_WALL_NORTH);
490 }
491 return isInactive(height, x, y - 1, TraversalConstants.WALL_NORTH | TraversalConstants.BLOCKED);
492 }

References com.runehive.game.world.pathfinding.TraversalConstants.BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_NORTH, isInactive(), and com.runehive.game.world.pathfinding.TraversalConstants.WALL_NORTH.

Here is the call graph for this function:

◆ isTraversableSouth() [3/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableSouth ( int height,
int x,
int y,
int size )
staticprivate

Tests if the specified position can be traversed south.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
sizeThe size of the entity attempting to traverse south.
Returns
true if it is possible to traverse south otherwise false

Definition at line 453 of file TraversalMap.java.

453 {
454 for (int offsetX = 0; offsetX < size; offsetX++) {
455 for (int offsetY = 0; offsetY < size; offsetY++) {
456 if (!isTraversableSouth(height, x + offsetX, y + offsetY)) {
457 return false;
458 }
459 }
460 }
461 return true;
462 }

References isTraversableSouth().

Referenced by blockedSouth(), getRandomNonDiagonal(), getRandomTraversableTile(), getTraversableTiles(), isTraversable(), isTraversable(), isTraversableSouth(), and isTraversableSouth().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isTraversableSouthEast() [1/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableSouthEast ( int height,
int x,
int y )
staticprivate

Tests if the specified position can be traversed south east.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
Returns
true if it is possible to traverse south east otherwise false.

Definition at line 728 of file TraversalMap.java.

728 {
729 return isTraversableSouthEast(height, x, y, false);
730 }

References isTraversableSouthEast().

Here is the call graph for this function:

◆ isTraversableSouthEast() [2/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableSouthEast ( int height,
int x,
int y,
boolean impenetrable )
staticprivate

Tests if the specified position can be traversed south east.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
impenetrableWhether or not this occupation can be traversed.
Returns
true if it is possible to traverse south east otherwise false.

Definition at line 742 of file TraversalMap.java.

742 {
743 if (impenetrable) {
744 return isInactive(height, x + 1, y - 1, TraversalConstants.IMPENETRABLE_WALL_WEST | TraversalConstants.IMPENETRABLE_WALL_NORTH | TraversalConstants.IMPENETRABLE_WALL_NORTH_WEST) && isInactive(height, x + 1, y, TraversalConstants.IMPENETRABLE_WALL_WEST | TraversalConstants.IMPENETRABLE_BLOCKED) && isInactive(height, x, y - 1, TraversalConstants.IMPENETRABLE_WALL_NORTH | TraversalConstants.IMPENETRABLE_BLOCKED);
745 }
746 return isInactive(height, x + 1, y - 1, TraversalConstants.WALL_WEST | TraversalConstants.WALL_NORTH | TraversalConstants.WALL_NORTH_WEST | TraversalConstants.BLOCKED) && isInactive(height, x + 1, y, TraversalConstants.WALL_WEST | TraversalConstants.BLOCKED) && isInactive(height, x, y - 1, TraversalConstants.WALL_NORTH | TraversalConstants.BLOCKED);
747 }

References com.runehive.game.world.pathfinding.TraversalConstants.BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_NORTH, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_NORTH_WEST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_WEST, isInactive(), com.runehive.game.world.pathfinding.TraversalConstants.WALL_NORTH, com.runehive.game.world.pathfinding.TraversalConstants.WALL_NORTH_WEST, and com.runehive.game.world.pathfinding.TraversalConstants.WALL_WEST.

Here is the call graph for this function:

◆ isTraversableSouthEast() [3/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableSouthEast ( int height,
int x,
int y,
int size )
staticprivate

Tests if the specified position can be traversed south east.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
sizeThe size of the entity attempting to traverse south east.
Returns
true if it is possible to traverse south east otherwise false

Definition at line 708 of file TraversalMap.java.

708 {
709 for (int offsetX = 0; offsetX < size; offsetX++) {
710 for (int offsetY = 0; offsetY < size; offsetY++) {
711 if (!isTraversableSouthEast(height, x + offsetX, y + offsetY)) {
712 return false;
713 }
714 }
715 }
716 return true;
717 }

References isTraversableSouthEast().

Referenced by getRandomTraversableTile(), getTraversableTiles(), isTraversable(), isTraversable(), isTraversableSouthEast(), and isTraversableSouthEast().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isTraversableSouthWest() [1/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableSouthWest ( int height,
int x,
int y )
staticprivate

Tests if the specified position can be traversed south west.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
Returns
true if it is possible to traverse south west otherwise false.

Definition at line 779 of file TraversalMap.java.

779 {
780 return isTraversableSouthWest(height, x, y, false);
781 }

References isTraversableSouthWest().

Here is the call graph for this function:

◆ isTraversableSouthWest() [2/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableSouthWest ( int height,
int x,
int y,
boolean impenetrable )
staticprivate

Tests if the specified position can be traversed south west.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
impenetrableWhether or not this occupation can be traversed.
Returns
true if it is possible to traverse south west otherwise false.

Definition at line 793 of file TraversalMap.java.

793 {
794 if (impenetrable) {
795 return isInactive(height, x - 1, y - 1, TraversalConstants.IMPENETRABLE_WALL_EAST | TraversalConstants.IMPENETRABLE_WALL_NORTH | TraversalConstants.IMPENETRABLE_WALL_NORTH_EAST) && isInactive(height, x - 1, y, TraversalConstants.IMPENETRABLE_WALL_EAST | TraversalConstants.IMPENETRABLE_BLOCKED) && isInactive(height, x, y - 1, TraversalConstants.IMPENETRABLE_WALL_NORTH | TraversalConstants.IMPENETRABLE_BLOCKED);
796 }
797 return isInactive(height, x - 1, y - 1, TraversalConstants.WALL_EAST | TraversalConstants.WALL_NORTH | TraversalConstants.WALL_NORTH_EAST | TraversalConstants.BLOCKED) && isInactive(height, x - 1, y, TraversalConstants.WALL_EAST | TraversalConstants.BLOCKED) && isInactive(height, x, y - 1, TraversalConstants.WALL_NORTH | TraversalConstants.BLOCKED);
798 }

References com.runehive.game.world.pathfinding.TraversalConstants.BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_EAST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_NORTH, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_NORTH_EAST, isInactive(), com.runehive.game.world.pathfinding.TraversalConstants.WALL_EAST, com.runehive.game.world.pathfinding.TraversalConstants.WALL_NORTH, and com.runehive.game.world.pathfinding.TraversalConstants.WALL_NORTH_EAST.

Here is the call graph for this function:

◆ isTraversableSouthWest() [3/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableSouthWest ( int height,
int x,
int y,
int size )
staticprivate

Tests if the specified position can be traversed south west.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
sizeThe size of the entity attempting to traverse south west.
Returns
true if it is possible to traverse south west otherwise false

Definition at line 759 of file TraversalMap.java.

759 {
760 for (int offsetX = 0; offsetX < size; offsetX++) {
761 for (int offsetY = 0; offsetY < size; offsetY++) {
762 if (!isTraversableSouthWest(height, x + offsetX, y + offsetY)) {
763 return false;
764 }
765 }
766 }
767 return true;
768 }

References isTraversableSouthWest().

Referenced by getRandomTraversableTile(), getTraversableTiles(), isTraversable(), isTraversable(), isTraversableSouthWest(), and isTraversableSouthWest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isTraversableWest() [1/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableWest ( int height,
int x,
int y )
staticprivate

Tests if the specified position can be traversed west.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
Returns
true if it is possible to traverse west otherwise false.

Definition at line 575 of file TraversalMap.java.

575 {
576 return isTraversableWest(height, x, y, false);
577 }

References isTraversableWest().

Here is the call graph for this function:

◆ isTraversableWest() [2/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableWest ( int height,
int x,
int y,
boolean impenetrable )
staticprivate

Tests if the specified position can be traversed west.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
impenetrableWhether or not this occupation can be traversed.
Returns
true if it is possible to traverse west otherwise false.

Definition at line 589 of file TraversalMap.java.

589 {
590 if (impenetrable) {
591 return isInactive(height, x - 1, y, TraversalConstants.IMPENETRABLE_BLOCKED | TraversalConstants.IMPENETRABLE_WALL_EAST);
592 }
593 return isInactive(height, x - 1, y, TraversalConstants.WALL_EAST | TraversalConstants.BLOCKED);
594 }

References com.runehive.game.world.pathfinding.TraversalConstants.BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_EAST, isInactive(), and com.runehive.game.world.pathfinding.TraversalConstants.WALL_EAST.

Here is the call graph for this function:

◆ isTraversableWest() [3/3]

boolean com.runehive.game.world.pathfinding.TraversalMap.isTraversableWest ( int height,
int x,
int y,
int size )
staticprivate

Tests if the specified position can be traversed west.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
sizeThe size of the entity attempting to traverse west.
Returns
true if it is possible to traverse west otherwise false

Definition at line 555 of file TraversalMap.java.

555 {
556 for (int width = 0; width < size; width++) {
557 for (int length = 0; length < size; length++) {
558 if (!isTraversableWest(height, x + width, y + length)) {
559 return false;
560 }
561 }
562 }
563 return true;
564 }

References isTraversableWest().

Referenced by blockedWest(), getRandomNonDiagonal(), getRandomTraversableTile(), getTraversableTiles(), isTraversable(), isTraversable(), isTraversableWest(), and isTraversableWest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ markBridge()

void com.runehive.game.world.pathfinding.TraversalMap.markBridge ( Region region,
int height,
int x,
int y )
static

Marks the specified coordinates a bridge.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.

Definition at line 388 of file TraversalMap.java.

388 {
389 set(region, height, x, y, TraversalConstants.BRIDGE);
390 }

References com.runehive.game.world.pathfinding.TraversalConstants.BRIDGE.

◆ markObject()

void com.runehive.game.world.pathfinding.TraversalMap.markObject ( Region region,
GameObject object,
boolean add,
boolean list )
static

Marks a GameObject with the specified attributes on the specified Position to the TraversalMap.

Parameters
objectThe game object.
addThe condition if the object is added.
listthe condition if the region object list will be affected.

Definition at line 36 of file TraversalMap.java.

36 {
37 if (object.getId() > GameObjectDefinition.MAX_DEFINITIONS) {
38 return;
39 }
40
41 GameObjectDefinition def = object.getDefinition();
42
43 if (def.isSolid()) {
44 Position position = object.getPosition();
45
46 //Sets the sizes.
47 final int sizeX;
48 final int sizeY;
49
50 if (object.getDirection() == ObjectDirection.NORTH || object.getDirection() == ObjectDirection.SOUTH) {
51 sizeX = def.getLength();
52 sizeY = def.getWidth();
53 } else {
54 sizeX = def.getWidth();
55 sizeY = def.getLength();
56 }
57
58 if (object.getObjectType() == GROUND_PROP) {
59 if (def.hasActions() || def.isDecoration()) {
60 if (def.hasActions()) {
61 markOccupant(region, position.getHeight(), position.getX(), position.getY(), sizeX, sizeY, false, add);
62 }
63 }
64 } else if (object.getObjectType() == GENERAL_PROP || object.getObjectType() == WALKABLE_PROP) {
65 markOccupant(region, position.getHeight(), position.getX(), position.getY(), sizeX, sizeY, def.isImpenetrable(), add);
66 } else if (object.getObjectType().getId() >= 12) {
67 markOccupant(region, position.getHeight(), position.getX(), position.getY(), sizeX, sizeY, def.isImpenetrable(), add);
68 } else if (object.getObjectType() == DIAGONAL_WALL) {
69 markOccupant(region, position.getHeight(), position.getX(), position.getY(), sizeX, sizeY, def.isImpenetrable(), add);
70 } else if (object.getObjectType().getId() >= 0 && object.getObjectType().getId() <= 3) {
71 if (add)
72 markWall(region, object.getDirection(), position.getHeight(), position.getX(), position.getY(), object.getObjectType(), def.isImpenetrable());
73 else
74 unmarkWall(region, object.getDirection(), position.getHeight(), position.getX(), position.getY(), object.getObjectType(), def.isImpenetrable());
75 }
76 }
77
78 if (list && (object.getId() == 11700 || object.getDefinition().hasActions())) {
79 if (add) region.addObject(object);
80 else region.removeObject(object);
81 }
82 }

References markOccupant(), markWall(), com.runehive.game.world.object.GameObjectDefinition.MAX_DEFINITIONS, com.runehive.game.world.object.ObjectDirection.NORTH, com.runehive.game.world.object.ObjectDirection.SOUTH, and unmarkWall().

Referenced by com.runehive.game.world.object.CustomGameObject.addToRegion(), com.runehive.fs.cache.decoder.RegionDecoder.parseGameObject(), com.runehive.game.world.object.StaticGameObject.register(), com.runehive.game.world.object.CustomGameObject.removeFromRegion(), and com.runehive.game.world.object.StaticGameObject.unregister().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ markOccupant()

void com.runehive.game.world.pathfinding.TraversalMap.markOccupant ( Region region,
int height,
int x,
int y,
int width,
int length,
boolean impenetrable,
boolean add )
static

Marks the specified coordinates occupied by some object.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
widthThe width of the occupation.
lengthThe length of the occupation.
impenetrableWhether or not this occupation can be passed through.
addFlag if the occupant is added or removed.

Definition at line 368 of file TraversalMap.java.

368 {
369 int flag = TraversalConstants.BLOCKED;
370 if (impenetrable) {
371 flag += TraversalConstants.IMPENETRABLE_BLOCKED;
372 }
373 for (int xPos = x; xPos < x + width; xPos++) {
374 for (int yPos = y; yPos < y + length; yPos++) {
375 if (add) set(region, height, xPos, yPos, flag);
376 else unset(region, height, xPos, yPos, flag);
377 }
378 }
379 }

References com.runehive.game.world.pathfinding.TraversalConstants.BLOCKED, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_BLOCKED, and unset().

Referenced by markObject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ markWall()

void com.runehive.game.world.pathfinding.TraversalMap.markWall ( Region reg,
ObjectDirection orientation,
int height,
int x,
int y,
ObjectType type,
boolean impenetrable )
staticprivate

Informs the region of an existing wall.

Parameters
orientationThe orientation of the wall.
heightThe walls height.
xThe walls x coordinate.
yThe walls y coordinate.
typeThe type of wall.
impenetrableWhether or not this wall can be passed through.

Definition at line 94 of file TraversalMap.java.

94 {
95 switch (type) {
96 case STRAIGHT_WALL:
97 if (orientation == ObjectDirection.WEST) {
98 set(reg, height, x, y, TraversalConstants.WALL_WEST);
99 set(reg, height, x - 1, y, TraversalConstants.WALL_EAST);
100 if (impenetrable) {
101 set(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_WEST);
102 set(reg, height, x - 1, y, TraversalConstants.IMPENETRABLE_WALL_EAST);
103 }
104 }
105 if (orientation == ObjectDirection.NORTH) {
106 set(reg, height, x, y, TraversalConstants.WALL_NORTH);
107 set(reg, height, x, y + 1, TraversalConstants.WALL_SOUTH);
108 if (impenetrable) {
109 set(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_NORTH);
110 set(reg, height, x, y + 1, TraversalConstants.IMPENETRABLE_WALL_SOUTH);
111 }
112 }
113 if (orientation == ObjectDirection.EAST) {
114 set(reg, height, x, y, TraversalConstants.WALL_EAST);
115 set(reg, height, x + 1, y, TraversalConstants.WALL_WEST);
116 if (impenetrable) {
117 set(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_EAST);
118 set(reg, height, x + 1, y, TraversalConstants.IMPENETRABLE_WALL_WEST);
119 }
120 }
121 if (orientation == ObjectDirection.SOUTH) {
122 set(reg, height, x, y, TraversalConstants.WALL_SOUTH);
123 set(reg, height, x, y - 1, TraversalConstants.WALL_NORTH);
124 if (impenetrable) {
125 set(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_SOUTH);
126 set(reg, height, x, y - 1, TraversalConstants.IMPENETRABLE_WALL_NORTH);
127 }
128 }
129 break;
130
131 case ENTIRE_WALL:
132 if (orientation == ObjectDirection.WEST) {
133 set(reg, height, x, y, TraversalConstants.WALL_WEST | TraversalConstants.WALL_NORTH);
134 set(reg, height, x - 1, y, TraversalConstants.WALL_EAST);
135 set(reg, height, x, y + 1, TraversalConstants.WALL_SOUTH);
136 if (impenetrable) {
137 set(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_WEST | TraversalConstants.IMPENETRABLE_WALL_NORTH);
138 set(reg, height, x - 1, y, TraversalConstants.IMPENETRABLE_WALL_EAST);
139 set(reg, height, x, y + 1, TraversalConstants.IMPENETRABLE_WALL_SOUTH);
140 }
141 }
142 if (orientation == ObjectDirection.NORTH) {
143 set(reg, height, x, y, TraversalConstants.WALL_EAST | TraversalConstants.WALL_NORTH);
144 set(reg, height, x, y + 1, TraversalConstants.WALL_SOUTH);
145 set(reg, height, x + 1, y, TraversalConstants.WALL_WEST);
146 if (impenetrable) {
147 set(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_EAST | TraversalConstants.IMPENETRABLE_WALL_NORTH);
148 set(reg, height, x, y + 1, TraversalConstants.IMPENETRABLE_WALL_SOUTH);
149 set(reg, height, x + 1, y, TraversalConstants.IMPENETRABLE_WALL_WEST);
150 }
151 }
152 if (orientation == ObjectDirection.EAST) {
153 set(reg, height, x, y, TraversalConstants.WALL_EAST | TraversalConstants.WALL_SOUTH);
154 set(reg, height, x + 1, y, TraversalConstants.WALL_WEST);
155 set(reg, height, x, y - 1, TraversalConstants.WALL_NORTH);
156 if (impenetrable) {
157 set(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_EAST | TraversalConstants.IMPENETRABLE_WALL_SOUTH);
158 set(reg, height, x + 1, y, TraversalConstants.IMPENETRABLE_WALL_WEST);
159 set(reg, height, x, y - 1, TraversalConstants.IMPENETRABLE_WALL_NORTH);
160 }
161 }
162 if (orientation == ObjectDirection.SOUTH) {
163 set(reg, height, x, y, TraversalConstants.WALL_WEST | TraversalConstants.WALL_SOUTH);
164 set(reg, height, x - 1, y, TraversalConstants.WALL_EAST);
165 set(reg, height, x, y - 1, TraversalConstants.WALL_NORTH);
166 if (impenetrable) {
167 set(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_WEST | TraversalConstants.IMPENETRABLE_WALL_SOUTH);
168 set(reg, height, x - 1, y, TraversalConstants.IMPENETRABLE_WALL_EAST);
169 set(reg, height, x, y - 1, TraversalConstants.IMPENETRABLE_WALL_NORTH);
170 }
171 }
172 break;
173
174 case DIAGONAL_CORNER_WALL:
175 case WALL_CORNER:
176 if (orientation == ObjectDirection.WEST) {
177 set(reg, height, x, y, TraversalConstants.WALL_NORTH_WEST);
178 set(reg, height, x - 1, y + 1, TraversalConstants.WALL_SOUTH_EAST);
179 if (impenetrable) {
180 set(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_NORTH_WEST);
181 set(reg, height, x - 1, y + 1, TraversalConstants.IMPENETRABLE_WALL_SOUTH_EAST);
182 }
183 }
184 if (orientation == ObjectDirection.NORTH) {
185 set(reg, height, x, y, TraversalConstants.WALL_NORTH_EAST);
186 set(reg, height, x + 1, y + 1, TraversalConstants.WALL_SOUTH_WEST);
187 if (impenetrable) {
188 set(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_NORTH_EAST);
189 set(reg, height, x + 1, y + 1, TraversalConstants.IMPENETRABLE_WALL_SOUTH_WEST);
190 }
191 }
192 if (orientation == ObjectDirection.EAST) {
193 set(reg, height, x, y, TraversalConstants.WALL_SOUTH_EAST);
194 set(reg, height, x + 1, y - 1, TraversalConstants.WALL_NORTH_WEST);
195 if (impenetrable) {
196 set(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_SOUTH_EAST);
197 set(reg, height, x + 1, y - 1, TraversalConstants.IMPENETRABLE_WALL_NORTH_WEST);
198 }
199 }
200 if (orientation == ObjectDirection.SOUTH) {
201 set(reg, height, x, y, TraversalConstants.WALL_SOUTH_WEST);
202 set(reg, height, x - 1, y - 1, TraversalConstants.WALL_NORTH_EAST);
203 if (impenetrable) {
204 set(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_SOUTH_WEST);
205 set(reg, height, x - 1, y - 1, TraversalConstants.IMPENETRABLE_WALL_NORTH_EAST);
206 }
207 }
208 break;
209 default:
210 break;
211 }
212 }

References com.runehive.game.world.object.ObjectDirection.EAST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_EAST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_NORTH, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_NORTH_EAST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_NORTH_WEST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_SOUTH, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_SOUTH_EAST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_SOUTH_WEST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_WEST, com.runehive.game.world.object.ObjectDirection.NORTH, com.runehive.game.world.object.ObjectDirection.SOUTH, com.runehive.game.world.pathfinding.TraversalConstants.WALL_EAST, com.runehive.game.world.pathfinding.TraversalConstants.WALL_NORTH, com.runehive.game.world.pathfinding.TraversalConstants.WALL_NORTH_EAST, com.runehive.game.world.pathfinding.TraversalConstants.WALL_NORTH_WEST, com.runehive.game.world.pathfinding.TraversalConstants.WALL_SOUTH, com.runehive.game.world.pathfinding.TraversalConstants.WALL_SOUTH_EAST, com.runehive.game.world.pathfinding.TraversalConstants.WALL_SOUTH_WEST, com.runehive.game.world.pathfinding.TraversalConstants.WALL_WEST, and com.runehive.game.world.object.ObjectDirection.WEST.

Referenced by markObject().

Here is the caller graph for this function:

◆ set()

void com.runehive.game.world.pathfinding.TraversalMap.set ( Region region,
int height,
int x,
int y,
int flag )
static

Sets a flag on the specified position.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
flagThe flag to put on this tile.

Definition at line 808 of file TraversalMap.java.

808 {
809 region.setFlags(height, x & 0x3F, y & 0x3F, flag);
810 }

◆ unmarkWall()

void com.runehive.game.world.pathfinding.TraversalMap.unmarkWall ( Region reg,
ObjectDirection orientation,
int height,
int x,
int y,
ObjectType type,
boolean impenetrable )
staticprivate

Informs the region of an existing wall being removed.

Parameters
orientationThe orientation of the wall.
heightThe walls height.
xThe walls x coordinate.
yThe walls y coordinate.
typeThe type of wall.
impenetrableWhether or not this wall can be passed through.

Definition at line 224 of file TraversalMap.java.

224 {
225 switch (type) {
226 case STRAIGHT_WALL:
227 if (orientation == ObjectDirection.WEST) {
228 unset(reg, height, x, y, TraversalConstants.WALL_WEST);
229 unset(reg, height, x - 1, y, TraversalConstants.WALL_EAST);
230 if (impenetrable) {
231 unset(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_WEST);
232 unset(reg, height, x - 1, y, TraversalConstants.IMPENETRABLE_WALL_EAST);
233 }
234 }
235 if (orientation == ObjectDirection.NORTH) {
236 unset(reg, height, x, y, TraversalConstants.WALL_NORTH);
237 unset(reg, height, x, y + 1, TraversalConstants.WALL_SOUTH);
238 if (impenetrable) {
239 unset(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_NORTH);
240 unset(reg, height, x, y + 1, TraversalConstants.IMPENETRABLE_WALL_SOUTH);
241 }
242 }
243 if (orientation == ObjectDirection.EAST) {
244 unset(reg, height, x, y, TraversalConstants.WALL_EAST);
245 unset(reg, height, x + 1, y, TraversalConstants.WALL_WEST);
246 if (impenetrable) {
247 unset(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_EAST);
248 unset(reg, height, x + 1, y, TraversalConstants.IMPENETRABLE_WALL_WEST);
249 }
250 }
251 if (orientation == ObjectDirection.SOUTH) {
252 unset(reg, height, x, y, TraversalConstants.WALL_SOUTH);
253 unset(reg, height, x, y - 1, TraversalConstants.WALL_NORTH);
254 if (impenetrable) {
255 unset(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_SOUTH);
256 unset(reg, height, x, y - 1, TraversalConstants.IMPENETRABLE_WALL_NORTH);
257 }
258 }
259 break;
260
261 case ENTIRE_WALL:
262 if (orientation == ObjectDirection.WEST) {
263 unset(reg, height, x, y, TraversalConstants.WALL_WEST | TraversalConstants.WALL_NORTH);
264 unset(reg, height, x - 1, y, TraversalConstants.WALL_EAST);
265 unset(reg, height, x, y + 1, TraversalConstants.WALL_SOUTH);
266 if (impenetrable) {
267 unset(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_WEST | TraversalConstants.IMPENETRABLE_WALL_NORTH);
268 unset(reg, height, x - 1, y, TraversalConstants.IMPENETRABLE_WALL_EAST);
269 unset(reg, height, x, y + 1, TraversalConstants.IMPENETRABLE_WALL_SOUTH);
270 }
271 }
272 if (orientation == ObjectDirection.NORTH) {
273 unset(reg, height, x, y, TraversalConstants.WALL_EAST | TraversalConstants.WALL_NORTH);
274 unset(reg, height, x, y + 1, TraversalConstants.WALL_SOUTH);
275 unset(reg, height, x + 1, y, TraversalConstants.WALL_WEST);
276 if (impenetrable) {
277 unset(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_EAST | TraversalConstants.IMPENETRABLE_WALL_NORTH);
278 unset(reg, height, x, y + 1, TraversalConstants.IMPENETRABLE_WALL_SOUTH);
279 unset(reg, height, x + 1, y, TraversalConstants.IMPENETRABLE_WALL_WEST);
280 }
281 }
282 if (orientation == ObjectDirection.EAST) {
283 unset(reg, height, x, y, TraversalConstants.WALL_EAST | TraversalConstants.WALL_SOUTH);
284 unset(reg, height, x + 1, y, TraversalConstants.WALL_WEST);
285 unset(reg, height, x, y - 1, TraversalConstants.WALL_NORTH);
286 if (impenetrable) {
287 unset(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_EAST | TraversalConstants.IMPENETRABLE_WALL_SOUTH);
288 unset(reg, height, x + 1, y, TraversalConstants.IMPENETRABLE_WALL_WEST);
289 unset(reg, height, x, y - 1, TraversalConstants.IMPENETRABLE_WALL_NORTH);
290 }
291 }
292 if (orientation == ObjectDirection.SOUTH) {
293 unset(reg, height, x, y, TraversalConstants.WALL_EAST | TraversalConstants.WALL_SOUTH);
294 unset(reg, height, x, y - 1, TraversalConstants.WALL_WEST);
295 unset(reg, height, x - 1, y, TraversalConstants.WALL_NORTH);
296 if (impenetrable) {
297 unset(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_EAST | TraversalConstants.IMPENETRABLE_WALL_SOUTH);
298 unset(reg, height, x, y - 1, TraversalConstants.IMPENETRABLE_WALL_WEST);
299 unset(reg, height, x - 1, y, TraversalConstants.IMPENETRABLE_WALL_NORTH);
300 }
301 }
302 break;
303
304 case DIAGONAL_CORNER_WALL:
305 case WALL_CORNER:
306 if (orientation == ObjectDirection.WEST) {
307 unset(reg, height, x, y, TraversalConstants.WALL_NORTH_WEST);
308 unset(reg, height, x - 1, y + 1, TraversalConstants.WALL_SOUTH_EAST);
309 if (impenetrable) {
310 unset(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_NORTH_WEST);
311 unset(reg, height, x - 1, y + 1, TraversalConstants.IMPENETRABLE_WALL_SOUTH_EAST);
312 }
313 }
314 if (orientation == ObjectDirection.NORTH) {
315 unset(reg, height, x, y, TraversalConstants.WALL_NORTH_EAST);
316 unset(reg, height, x + 1, y + 1, TraversalConstants.WALL_SOUTH_WEST);
317 if (impenetrable) {
318 unset(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_NORTH_EAST);
319 unset(reg, height, x + 1, y + 1, TraversalConstants.IMPENETRABLE_WALL_SOUTH_WEST);
320 }
321 }
322 if (orientation == ObjectDirection.EAST) {
323 unset(reg, height, x, y, TraversalConstants.WALL_SOUTH_EAST);
324 unset(reg, height, x + 1, y - 1, TraversalConstants.WALL_NORTH_WEST);
325 if (impenetrable) {
326 unset(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_SOUTH_EAST);
327 unset(reg, height, x + 1, y - 1, TraversalConstants.IMPENETRABLE_WALL_NORTH_WEST);
328 }
329 }
330 if (orientation == ObjectDirection.SOUTH) {
331 unset(reg, height, x, y, TraversalConstants.WALL_SOUTH_WEST);
332 unset(reg, height, x - 1, y - 1, TraversalConstants.WALL_NORTH_EAST);
333 if (impenetrable) {
334 unset(reg, height, x, y, TraversalConstants.IMPENETRABLE_WALL_SOUTH_WEST);
335 unset(reg, height, x - 1, y - 1, TraversalConstants.IMPENETRABLE_WALL_NORTH_EAST);
336 }
337 }
338 break;
339 default:
340 break;
341 }
342 }

References com.runehive.game.world.object.ObjectDirection.EAST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_EAST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_NORTH, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_NORTH_EAST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_NORTH_WEST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_SOUTH, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_SOUTH_EAST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_SOUTH_WEST, com.runehive.game.world.pathfinding.TraversalConstants.IMPENETRABLE_WALL_WEST, com.runehive.game.world.object.ObjectDirection.NORTH, com.runehive.game.world.object.ObjectDirection.SOUTH, unset(), com.runehive.game.world.pathfinding.TraversalConstants.WALL_EAST, com.runehive.game.world.pathfinding.TraversalConstants.WALL_NORTH, com.runehive.game.world.pathfinding.TraversalConstants.WALL_NORTH_EAST, com.runehive.game.world.pathfinding.TraversalConstants.WALL_NORTH_WEST, com.runehive.game.world.pathfinding.TraversalConstants.WALL_SOUTH, com.runehive.game.world.pathfinding.TraversalConstants.WALL_SOUTH_EAST, com.runehive.game.world.pathfinding.TraversalConstants.WALL_SOUTH_WEST, com.runehive.game.world.pathfinding.TraversalConstants.WALL_WEST, and com.runehive.game.world.object.ObjectDirection.WEST.

Referenced by markObject().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unset()

void com.runehive.game.world.pathfinding.TraversalMap.unset ( Region region,
int height,
int x,
int y,
int flag )
staticprivate

Unsets the specified flag from the specified position.

Parameters
heightThe height.
xThe x coordinate.
yThe y coordinate.
flagThe flag to unset from the specified position.

Definition at line 838 of file TraversalMap.java.

838 {
839 region.unsetFlags(height, x & 0x3F, y & 0x3F, flag);
840 }

Referenced by markOccupant(), and unmarkWall().

Here is the caller graph for this function:

The documentation for this class was generated from the following file: