|
RuneHive-Game
|
Manages the world regions. More...
Public Member Functions | |
| List< Npc > | getLocalNpcs (Mob mob) |
| Gets the local npcs around an entity. | |
| List< Player > | getLocalPlayers (Mob mob) |
| Gets the local players around an entity. | |
| Region | getRegion (final int x, final int y) |
| Gets a region by its x and y coordinates. | |
| Region | getRegion (Position position) |
| Gets a region by position. | |
| Region[] | getSurroundingRegions (Position position) |
| Gets the regions surrounding a position. | |
Static Public Member Functions | |
| static void | forNearbyPlayer (Mob mob, int distance, Consumer< Player > action) |
Sends an action to Mob instance which is within a . | |
| static void | forNearbyPlayer (Position position, int distance, Consumer< Player > action) |
Sends an action to Mob instance which is within a . | |
Static Private Member Functions | |
| static int | hash (int x, int y) |
Private Attributes | |
| final Int2ObjectMap< Region > | activeRegions = new Int2ObjectOpenHashMap<>() |
| The active (loaded) region map. | |
Manages the world regions.
Definition at line 20 of file RegionManager.java.
|
static |
Sends an action to Mob instance which is within a .
distance
| action | action consumer. |
Definition at line 31 of file RegionManager.java.
References com.runehive.util.Utility.getDistance(), com.runehive.game.world.entity.Entity.getHeight(), com.runehive.game.world.entity.Entity.getRegion(), and com.runehive.game.world.region.Region.getSurroundingRegions().
Referenced by com.runehive.game.world.entity.combat.strategy.npc.boss.Vetion.Earthquake.hit(), com.runehive.content.clanchannel.channel.ClanChannel.splitLoot(), com.runehive.game.world.entity.combat.strategy.npc.boss.skotizo.Skotizo.LightingRain.start(), com.runehive.game.world.entity.combat.strategy.npc.boss.skotizo.Skotizo.Magic.start(), and com.runehive.game.world.entity.combat.strategy.npc.boss.Vetion.Magic.start().
|
static |
Sends an action to Mob instance which is within a .
distance
| action | action consumer. |
Definition at line 50 of file RegionManager.java.
References com.runehive.util.Utility.getDistance().
Gets the local npcs around an entity.
| mob | The entity. |
Definition at line 88 of file RegionManager.java.
References com.runehive.game.world.entity.Entity.getHeight(), com.runehive.game.world.entity.Entity.getPosition(), getSurroundingRegions(), com.runehive.game.world.position.Position.isWithinDistance(), and com.runehive.game.world.region.Region.VIEW_DISTANCE.
Referenced by com.runehive.game.world.entity.combat.CombatUtil.areaAction(), and com.runehive.net.packet.out.SendNpcUpdate.encode().
Gets the local players around an entity.
| mob | The entity. |
Definition at line 69 of file RegionManager.java.
References com.runehive.game.world.entity.Entity.getHeight(), com.runehive.game.world.entity.Entity.getPosition(), getSurroundingRegions(), com.runehive.game.world.position.Position.isWithinDistance(), and com.runehive.game.world.region.Region.VIEW_DISTANCE.
Referenced by com.runehive.game.world.entity.combat.CombatUtil.areaAction(), and com.runehive.net.packet.out.SendPlayerUpdate.encode().
| Region com.runehive.game.world.region.RegionManager.getRegion | ( | final int | x, |
| final int | y ) |
Gets a region by its x and y coordinates.
| x | The x coordinate. |
| y | The y coordinate. |
Definition at line 151 of file RegionManager.java.
References activeRegions, and hash().
Gets a region by position.
| position | The position. |
Definition at line 140 of file RegionManager.java.
References getRegion().
Referenced by com.runehive.content.Obelisks.activate(), com.runehive.game.world.pathfinding.TraversalMap.getFlags(), com.runehive.game.world.position.Position.getRegion(), getRegion(), getSurroundingRegions(), com.runehive.content.wintertodt.Wintertodt.init(), com.runehive.game.world.pathfinding.TraversalMap.isInactive(), and com.runehive.fs.cache.decoder.RegionDecoder.load().
Gets the regions surrounding a position.
| position | The position. |
Definition at line 106 of file RegionManager.java.
References getRegion(), com.runehive.game.world.region.Region.getSurroundingRegions(), and com.runehive.game.world.region.Region.setSurroundingRegions().
Referenced by com.runehive.game.world.items.ground.GroundItem.addToRegion(), com.runehive.game.world.object.CustomGameObject.addToRegion(), com.runehive.game.world.items.ground.GroundItemEvent.execute(), getLocalNpcs(), getLocalPlayers(), com.runehive.game.world.entity.mob.player.Player.loadRegion(), com.runehive.game.world.object.StaticGameObject.register(), com.runehive.game.world.items.ground.GroundItem.removeFromRegion(), com.runehive.game.world.object.CustomGameObject.removeFromRegion(), and com.runehive.game.world.object.StaticGameObject.unregister().
|
staticprivate |
Definition at line 164 of file RegionManager.java.
Referenced by getRegion().
|
private |
The active (loaded) region map.
Definition at line 23 of file RegionManager.java.
Referenced by getRegion().