RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.game.world.region.RegionDefinition Class Reference

Represents a single region definition. More...

Public Member Functions

int getHash ()
 Returns the coordinate hash.
int getObjectFile ()
 Returns the object file id.
int getTerrainFile ()
 Returns the terrain file id.
 RegionDefinition (int hash, int terrainFile, int objectFile)
 Constructs a new RegionDefinition with the specified hash, terrain file id, object file id and preload state.

Static Public Member Functions

static boolean contains (int region)
 Returns the flag if the region exists.
static RegionDefinition get (int region)
 Gets a RegionDefinition.
static Int2ObjectMap< RegionDefinitiongetDefinitions ()
 Gets the regional definitions.
static void set (RegionDefinition definition)
 Adds a RegionDefinition.

Private Attributes

final int hash
 The hash of the region coordinates.
final int objectFile
 The object file id.
final int terrainFile
 The terrain file id.

Static Private Attributes

static final Int2ObjectMap< RegionDefinitionDEFINITIONS = new Int2ObjectOpenHashMap<>(8192)
 The region definitions.

Detailed Description

Represents a single region definition.

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

Definition at line 12 of file RegionDefinition.java.

Constructor & Destructor Documentation

◆ RegionDefinition()

com.runehive.game.world.region.RegionDefinition.RegionDefinition ( int hash,
int terrainFile,
int objectFile )

Constructs a new RegionDefinition with the specified hash, terrain file id, object file id and preload state.

Parameters
hashThe hash of the region coordinates.
terrainFileThe terrain file id.
objectFileThe object file id.

Definition at line 34 of file RegionDefinition.java.

34 {
35 this.hash = hash;
36 this.terrainFile = terrainFile;
37 this.objectFile = objectFile;
38 }

References hash, objectFile, and terrainFile.

Referenced by get(), and set().

Here is the caller graph for this function:

Member Function Documentation

◆ contains()

boolean com.runehive.game.world.region.RegionDefinition.contains ( int region)
static

Returns the flag if the region exists.

Parameters
regionregion hash to check.
Returns
contains flag.

Definition at line 56 of file RegionDefinition.java.

56 {
57 return DEFINITIONS.containsKey(region);
58 }

References DEFINITIONS.

◆ get()

RegionDefinition com.runehive.game.world.region.RegionDefinition.get ( int region)
static

Gets a RegionDefinition.

Parameters
regionregion hash to get definition from.
Returns
region definition

Definition at line 46 of file RegionDefinition.java.

46 {
47 return DEFINITIONS.get(region);
48 }

References DEFINITIONS, and RegionDefinition().

Here is the call graph for this function:

◆ getDefinitions()

Int2ObjectMap< RegionDefinition > com.runehive.game.world.region.RegionDefinition.getDefinitions ( )
static

Gets the regional definitions.

Returns
region definitions.

Definition at line 74 of file RegionDefinition.java.

74 {
75 return DEFINITIONS;
76 }

References DEFINITIONS.

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

Here is the caller graph for this function:

◆ getHash()

int com.runehive.game.world.region.RegionDefinition.getHash ( )

Returns the coordinate hash.

Definition at line 81 of file RegionDefinition.java.

81 {
82 return hash;
83 }

References hash.

◆ getObjectFile()

int com.runehive.game.world.region.RegionDefinition.getObjectFile ( )

Returns the object file id.

Definition at line 95 of file RegionDefinition.java.

95 {
96 return objectFile;
97 }

References objectFile.

◆ getTerrainFile()

int com.runehive.game.world.region.RegionDefinition.getTerrainFile ( )

Returns the terrain file id.

Definition at line 88 of file RegionDefinition.java.

88 {
89 return terrainFile;
90 }

References terrainFile.

◆ set()

void com.runehive.game.world.region.RegionDefinition.set ( RegionDefinition definition)
static

Adds a RegionDefinition.

Parameters
definitiondefinition to add.

Definition at line 65 of file RegionDefinition.java.

65 {
66 DEFINITIONS.put(definition.getHash(), definition);
67 }

References DEFINITIONS, and RegionDefinition().

Referenced by com.runehive.fs.cache.decoder.MapDefinitionDecoder.run().

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

Member Data Documentation

◆ DEFINITIONS

final Int2ObjectMap<RegionDefinition> com.runehive.game.world.region.RegionDefinition.DEFINITIONS = new Int2ObjectOpenHashMap<>(8192)
staticprivate

The region definitions.

Definition at line 15 of file RegionDefinition.java.

Referenced by contains(), get(), getDefinitions(), and set().

◆ hash

final int com.runehive.game.world.region.RegionDefinition.hash
private

The hash of the region coordinates.

Definition at line 18 of file RegionDefinition.java.

Referenced by getHash(), and RegionDefinition().

◆ objectFile

final int com.runehive.game.world.region.RegionDefinition.objectFile
private

The object file id.

Definition at line 24 of file RegionDefinition.java.

Referenced by getObjectFile(), and RegionDefinition().

◆ terrainFile

final int com.runehive.game.world.region.RegionDefinition.terrainFile
private

The terrain file id.

Definition at line 21 of file RegionDefinition.java.

Referenced by getTerrainFile(), and RegionDefinition().


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