RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.fs.cache.decoder.MapDefinitionDecoder Class Reference

A class which parses RegionDefinitions. More...

Inheritance diagram for com.runehive.fs.cache.decoder.MapDefinitionDecoder:
Collaboration diagram for com.runehive.fs.cache.decoder.MapDefinitionDecoder:

Public Member Functions

 MapDefinitionDecoder (FileSystem fs)
 Creates the MapDefinitionDecoder.
void run ()

Private Attributes

final FileSystem fs
 The IndexedFileSystem.

Static Private Attributes

static final Logger LOGGER = LogManager.getLogger(MapDefinitionDecoder.class)
 The logger that will print important information.

Detailed Description

Constructor & Destructor Documentation

◆ MapDefinitionDecoder()

com.runehive.fs.cache.decoder.MapDefinitionDecoder.MapDefinitionDecoder ( FileSystem fs)

Creates the MapDefinitionDecoder.

Parameters
fsThe FileSystem.

Definition at line 30 of file MapDefinitionDecoder.java.

30 {
31 this.fs = fs;
32 }

References fs.

Member Function Documentation

◆ run()

void com.runehive.fs.cache.decoder.MapDefinitionDecoder.run ( )

Definition at line 35 of file MapDefinitionDecoder.java.

35 {
36 LOGGER.info("Loading region definitions.");
37 Archive archive = fs.getArchive(FileSystem.MANIFEST_ARCHIVE);
38 ByteBuffer buffer = archive.getData("map_index");
39 int count = (buffer.getShort() & 0xFFFF);
40 for (int i = 0; i < count; i++) {
41 int hash = buffer.getShort() & 0xFFFF;
42 int terrainFile = buffer.getShort() & 0xFFFF;
43 int objectFile = buffer.getShort() & 0xFFFF;
44 RegionDefinition.set(new RegionDefinition(hash, terrainFile, objectFile));
45 }
46 LOGGER.info("Loaded " + count + " region definitions.");
47 }

References fs, LOGGER, com.runehive.fs.cache.FileSystem.MANIFEST_ARCHIVE, and com.runehive.game.world.region.RegionDefinition.set().

Referenced by com.runehive.RuneHive.processSequentialStartupTasks().

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

Member Data Documentation

◆ fs

final FileSystem com.runehive.fs.cache.decoder.MapDefinitionDecoder.fs
private

The IndexedFileSystem.

Definition at line 23 of file MapDefinitionDecoder.java.

Referenced by MapDefinitionDecoder(), and run().

◆ LOGGER

final Logger com.runehive.fs.cache.decoder.MapDefinitionDecoder.LOGGER = LogManager.getLogger(MapDefinitionDecoder.class)
staticprivate

The logger that will print important information.

Definition at line 20 of file MapDefinitionDecoder.java.

Referenced by run().


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