|
RuneHive-Game
|
Represents a single region. More...
Public Member Functions | |
| void | addGroundItem (GroundItem item) |
| Adds a ground item to this region. | |
| void | addNpc (Npc npc) |
| Adds an npc to this region. | |
| void | addObject (GameObject object) |
| Adds an object to this region. | |
| void | addPlayer (Player player) |
| Adds a player to this region. | |
| boolean | contains (int x, int y) |
| boolean | contains (Position position) |
| boolean | containsNpc (int height, Npc npc) |
| boolean | containsObject (int height, GameObject object) |
| boolean | containsObject (Position position) |
| boolean | containsPlayer (int height, Player player) |
| GameObject | getCustomObject (int id, Position position) |
| int | getFlags (int height, int x, int y) |
| Gets a single tile in this region from the specified height, x and y coordinates. | |
| GameObject | getGameObject (int id, Position position) |
| GroundItem | getGroundItem (int id, Position position) |
| Set< GroundItem > | getGroundItems (Position position) |
| int | getId () |
| Collection< Npc > | getNpcs (int height) |
| List< GameObject > | getObjects (Position position) |
| Collection< Player > | getPlayers (int height) |
| Optional< Region[]> | getSurroundingRegions () |
| int | getX () |
| int | getY () |
| Region (int x, int y) | |
| Creates a region. | |
| void | removeGroundItem (GroundItem item) |
| Adds a ground item to this region. | |
| void | removeNpc (Npc npc) |
| Removes an npc from this region. | |
| void | removeObject (GameObject object) |
| Removes an object from this region. | |
| void | removePlayer (Player player) |
| Removes a player from this region. | |
| void | sendGameObjects (Player player) |
Sends game objects in this region to the player. | |
| void | sendGroundItems (Player player) |
Sends ground items in this region to the player. | |
| void | setFlags (int height, int x, int y, int flags) |
| Gets a single tile in this region from the specified height, x and y coordinates. | |
| void | setSurroundingRegions (Optional< Region[]> surroundingRegions) |
| void | skip (GameObject gameObject) |
| String | toString () |
| void | unsetFlags (int height, int x, int y, int flags) |
| Gets a single tile in this region from the specified height, x and y coordinates. | |
Static Public Member Functions | |
| static boolean | reachable (Interactable source, Interactable target) |
| static boolean | reachable (Position source, int sourceWidth, int sourceLength, Position target, int targetWidth, int targetLength) |
Static Public Attributes | |
| static final Map< Position, GameObject > | ACTIVE_OBJECT = new HashMap<>() |
| static final int | SIZE = CHUNK_SIZE * 8 |
| static final Set< Position > | SKIPPED_OBJECTS = new HashSet<>() |
| static final int | VIEW_DISTANCE = SIZE / 4 - 1 |
Private Member Functions | |
| RegionBlock | getBlock (int height) |
Private Attributes | |
| final RegionBlock[] | blocks = new RegionBlock[HEIGHT_LEVELS] |
| The region blocks that execute different heights. | |
| int | id |
| The region id. | |
| Optional< Region[]> | surroundingRegions = Optional.empty() |
| The surrounded regions. | |
| int | x |
| The region coordinates. | |
| int | y |
Static Private Attributes | |
| static final int | CHUNK_SIZE = 8 |
Represents a single region.
Definition at line 21 of file Region.java.
| com.runehive.game.world.region.Region.Region | ( | int | x, |
| int | y ) |
Creates a region.
Definition at line 41 of file Region.java.
Referenced by setSurroundingRegions().
| void com.runehive.game.world.region.Region.addGroundItem | ( | GroundItem | item | ) |
Adds a ground item to this region.
Definition at line 150 of file Region.java.
References com.runehive.game.world.region.RegionBlock.addGroundItem(), getBlock(), and com.runehive.game.world.entity.Entity.getHeight().
| void com.runehive.game.world.region.Region.addNpc | ( | Npc | npc | ) |
Adds an npc to this region.
Definition at line 130 of file Region.java.
References com.runehive.game.world.region.RegionBlock.addNpc(), getBlock(), and com.runehive.game.world.entity.Entity.getHeight().
| void com.runehive.game.world.region.Region.addObject | ( | GameObject | object | ) |
Adds an object to this region.
Definition at line 140 of file Region.java.
References com.runehive.game.world.region.RegionBlock.addObject(), and getBlock().
| void com.runehive.game.world.region.Region.addPlayer | ( | Player | player | ) |
Adds a player to this region.
Definition at line 120 of file Region.java.
References com.runehive.game.world.region.RegionBlock.addPlayer(), getBlock(), and com.runehive.game.world.entity.Entity.getHeight().
| boolean com.runehive.game.world.region.Region.contains | ( | int | x, |
| int | y ) |
| boolean com.runehive.game.world.region.Region.contains | ( | Position | position | ) |
true if the region contains the position Definition at line 206 of file Region.java.
References getX(), and getY().
| boolean com.runehive.game.world.region.Region.containsNpc | ( | int | height, |
| Npc | npc ) |
Definition at line 159 of file Region.java.
References com.runehive.game.world.region.RegionBlock.containsNpc(), and getBlock().
| boolean com.runehive.game.world.region.Region.containsObject | ( | int | height, |
| GameObject | object ) |
true if object is in region Definition at line 168 of file Region.java.
References com.runehive.game.world.region.RegionBlock.containsObject(), and getBlock().
Referenced by com.runehive.game.world.object.StaticGameObject.active(), com.runehive.game.world.object.CustomGameObject.addToRegion(), com.runehive.content.skill.impl.firemaking.FiremakingAction.canInit(), com.runehive.content.combat.cannon.Cannon.register(), com.runehive.game.world.object.StaticGameObject.register(), com.runehive.game.world.object.CustomGameObject.removeFromRegion(), and com.runehive.game.world.object.StaticGameObject.unregister().
| boolean com.runehive.game.world.region.Region.containsObject | ( | Position | position | ) |
true if object occupies position Definition at line 173 of file Region.java.
References com.runehive.game.world.region.RegionBlock.containsObject(), and getBlock().
| boolean com.runehive.game.world.region.Region.containsPlayer | ( | int | height, |
| Player | player ) |
Definition at line 163 of file Region.java.
References com.runehive.game.world.region.RegionBlock.containsPlayer(), and getBlock().
|
private |
Definition at line 215 of file Region.java.
References blocks.
Referenced by addGroundItem(), addNpc(), addObject(), addPlayer(), containsNpc(), containsObject(), containsObject(), containsPlayer(), getCustomObject(), getFlags(), getGameObject(), getGroundItem(), getGroundItems(), getNpcs(), getObjects(), getPlayers(), removeGroundItem(), removeNpc(), removeObject(), removePlayer(), sendGameObjects(), sendGroundItems(), setFlags(), skip(), and unsetFlags().
| GameObject com.runehive.game.world.region.Region.getCustomObject | ( | int | id, |
| Position | position ) |
Definition at line 187 of file Region.java.
References getBlock(), and com.runehive.game.world.region.RegionBlock.getCustomObject().
| int com.runehive.game.world.region.Region.getFlags | ( | int | height, |
| int | x, | ||
| int | y ) |
Gets a single tile in this region from the specified height, x and y coordinates.
| height | The height. |
| x | The x coordinate. |
| y | The y coordinate. |
Definition at line 66 of file Region.java.
References getBlock(), com.runehive.game.world.region.RegionBlock.getFlags(), x, and y.
| GameObject com.runehive.game.world.region.Region.getGameObject | ( | int | id, |
| Position | position ) |
true if object with given id occupies position Definition at line 183 of file Region.java.
References getBlock(), and com.runehive.game.world.region.RegionBlock.getGameObject().
Referenced by com.runehive.content.Obelisks.activate().
| GroundItem com.runehive.game.world.region.Region.getGroundItem | ( | int | id, |
| Position | position ) |
Definition at line 115 of file Region.java.
References getBlock(), and com.runehive.game.world.region.RegionBlock.getGroundItem().
| Set< GroundItem > com.runehive.game.world.region.Region.getGroundItems | ( | Position | position | ) |
Definition at line 178 of file Region.java.
References getBlock(), and com.runehive.game.world.region.RegionBlock.getGroundItems().
| int com.runehive.game.world.region.Region.getId | ( | ) |
| Collection< Npc > com.runehive.game.world.region.Region.getNpcs | ( | int | height | ) |
Definition at line 110 of file Region.java.
References getBlock(), and com.runehive.game.world.region.RegionBlock.getNpcs().
Referenced by com.runehive.game.world.entity.combat.CombatTarget.checkAggression().
| List< GameObject > com.runehive.game.world.region.Region.getObjects | ( | Position | position | ) |
Definition at line 191 of file Region.java.
References getBlock(), and com.runehive.game.world.region.RegionBlock.getGameObjects().
| Collection< Player > com.runehive.game.world.region.Region.getPlayers | ( | int | height | ) |
Definition at line 105 of file Region.java.
References getBlock(), and com.runehive.game.world.region.RegionBlock.getPlayers().
Referenced by com.runehive.content.combat.cannon.Cannon.addToRegion(), com.runehive.content.combat.cannon.Cannon.removeFromRegion(), and com.runehive.game.world.entity.combat.strategy.npc.boss.StoneGuardian.BoomAttack.start().
| Optional< Region[]> com.runehive.game.world.region.Region.getSurroundingRegions | ( | ) |
Definition at line 96 of file Region.java.
References surroundingRegions.
Referenced by com.runehive.game.world.region.RegionManager.forNearbyPlayer(), and com.runehive.game.world.region.RegionManager.getSurroundingRegions().
| int com.runehive.game.world.region.Region.getX | ( | ) |
Definition at line 48 of file Region.java.
References x.
Referenced by contains(), and contains().
| int com.runehive.game.world.region.Region.getY | ( | ) |
Definition at line 53 of file Region.java.
References y.
Referenced by contains(), and contains().
|
static |
Definition at line 227 of file Region.java.
References com.runehive.game.world.Interactable.getPosition(), com.runehive.game.world.Interactable.length(), reachable(), and com.runehive.game.world.Interactable.width().
Referenced by com.runehive.game.world.pathfinding.path.impl.SimplePathFinder.addWalks(), com.runehive.game.world.pathfinding.path.impl.DijkstraPathFinder.find(), and reachable().
|
static |
Definition at line 231 of file Region.java.
References com.runehive.game.world.pathfinding.TraversalMap.blockedEast(), com.runehive.game.world.pathfinding.TraversalMap.blockedNorth(), com.runehive.game.world.pathfinding.TraversalMap.blockedSouth(), com.runehive.game.world.pathfinding.TraversalMap.blockedWest(), com.runehive.game.world.position.Position.getX(), com.runehive.game.world.position.Position.getY(), com.runehive.util.Utility.inside(), com.runehive.game.world.position.Position.transform(), x, and y.
| void com.runehive.game.world.region.Region.removeGroundItem | ( | GroundItem | item | ) |
Adds a ground item to this region.
Definition at line 155 of file Region.java.
References getBlock(), com.runehive.game.world.entity.Entity.getHeight(), and com.runehive.game.world.region.RegionBlock.removeGroundItem().
| void com.runehive.game.world.region.Region.removeNpc | ( | Npc | npc | ) |
Removes an npc from this region.
Definition at line 135 of file Region.java.
References getBlock(), com.runehive.game.world.entity.Entity.getHeight(), and com.runehive.game.world.region.RegionBlock.removeNpc().
| void com.runehive.game.world.region.Region.removeObject | ( | GameObject | object | ) |
Removes an object from this region.
Definition at line 145 of file Region.java.
References getBlock(), and com.runehive.game.world.region.RegionBlock.removeObject().
| void com.runehive.game.world.region.Region.removePlayer | ( | Player | player | ) |
Removes a player from this region.
Definition at line 125 of file Region.java.
References getBlock(), com.runehive.game.world.entity.Entity.getHeight(), and com.runehive.game.world.region.RegionBlock.removePlayer().
| void com.runehive.game.world.region.Region.sendGameObjects | ( | Player | player | ) |
Sends game objects in this region to the player.
Definition at line 201 of file Region.java.
References getBlock(), com.runehive.game.world.entity.Entity.getHeight(), and com.runehive.game.world.region.RegionBlock.sendGameObjects().
| void com.runehive.game.world.region.Region.sendGroundItems | ( | Player | player | ) |
Sends ground items in this region to the player.
Definition at line 196 of file Region.java.
References getBlock(), com.runehive.game.world.entity.Entity.getHeight(), and com.runehive.game.world.region.RegionBlock.sendGroundItems().
| void com.runehive.game.world.region.Region.setFlags | ( | int | height, |
| int | x, | ||
| int | y, | ||
| int | flags ) |
Gets a single tile in this region from the specified height, x and y coordinates.
| height | The height. |
| x | The x coordinate. |
| y | The y coordinate. |
Definition at line 79 of file Region.java.
References getBlock(), com.runehive.game.world.region.RegionBlock.setFlags(), x, and y.
| void com.runehive.game.world.region.Region.setSurroundingRegions | ( | Optional< Region[]> | surroundingRegions | ) |
Definition at line 100 of file Region.java.
References Region(), and surroundingRegions.
Referenced by com.runehive.game.world.region.RegionManager.getSurroundingRegions().
| void com.runehive.game.world.region.Region.skip | ( | GameObject | gameObject | ) |
Definition at line 273 of file Region.java.
References getBlock(), com.runehive.game.world.Interactable.getHeight(), and com.runehive.game.world.region.RegionBlock.skip().
| String com.runehive.game.world.region.Region.toString | ( | ) |
Definition at line 278 of file Region.java.
| void com.runehive.game.world.region.Region.unsetFlags | ( | int | height, |
| int | x, | ||
| int | y, | ||
| int | flags ) |
Gets a single tile in this region from the specified height, x and y coordinates.
| height | The height. |
| x | The x coordinate. |
| y | The y coordinate. |
Definition at line 92 of file Region.java.
References getBlock(), com.runehive.game.world.region.RegionBlock.unsetFlags(), x, and y.
|
static |
Definition at line 25 of file Region.java.
Referenced by com.runehive.game.world.object.CustomGameObject.register(), and com.runehive.game.world.object.CustomGameObject.unregister().
|
private |
The region blocks that execute different heights.
Definition at line 35 of file Region.java.
Referenced by getBlock().
|
staticprivate |
Definition at line 22 of file Region.java.
|
private |
|
static |
Definition at line 23 of file Region.java.
Referenced by com.runehive.game.world.entity.combat.CombatTarget.checkAggression(), com.runehive.game.world.pathfinding.path.impl.AStarPathFinder.find(), com.runehive.game.world.pathfinding.path.impl.DijkstraPathFinder.find(), and com.runehive.content.skill.impl.farming.zones.FarmingZone.isViewable().
|
static |
Definition at line 26 of file Region.java.
Referenced by com.runehive.util.parser.impl.ObjectRemovalParser.parse(), and com.runehive.fs.cache.decoder.RegionDecoder.parseGameObject().
|
private |
The surrounded regions.
Definition at line 38 of file Region.java.
Referenced by getSurroundingRegions(), and setSurroundingRegions().
|
static |
Definition at line 24 of file Region.java.
Referenced by com.runehive.game.world.entity.combat.CombatTarget.checkAggression(), com.runehive.game.world.entity.combat.Combat< T extends Mob >.checkDistances(), com.runehive.game.world.entity.combat.CombatTarget.compare(), com.runehive.game.world.entity.mob.movement.waypoint.Waypoint.findRoute(), com.runehive.game.world.region.RegionManager.getLocalNpcs(), com.runehive.game.world.region.RegionManager.getLocalPlayers(), com.runehive.content.combat.cannon.CannonManager.getNpc(), com.runehive.game.world.object.StaticGameObject.register(), com.runehive.game.world.entity.mob.player.requests.RequestManager.request(), com.runehive.game.world.World.sendGraphic(), com.runehive.game.world.World.sendGraphic(), com.runehive.game.world.World.sendObjectAnimation(), com.runehive.game.world.World.sendProjectile(), com.runehive.game.world.World.sendProjectile(), com.runehive.game.world.World.sendProjectile(), com.runehive.game.world.World.sendProjectile(), com.runehive.game.world.World.sendProjectile(), and com.runehive.game.world.object.StaticGameObject.unregister().
|
private |
The region coordinates.
Definition at line 32 of file Region.java.
Referenced by contains(), getFlags(), getX(), reachable(), Region(), setFlags(), toString(), and unsetFlags().
|
private |
Definition at line 32 of file Region.java.
Referenced by contains(), getFlags(), getY(), reachable(), Region(), setFlags(), toString(), and unsetFlags().