RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.util.parser.old.EquipmentParser Class Reference
Inheritance diagram for com.runehive.util.parser.old.EquipmentParser:
Collaboration diagram for com.runehive.util.parser.old.EquipmentParser:

Classes

class  Loader

Public Member Functions

 EquipmentParser ()
Public Member Functions inherited from com.runehive.util.parser.GsonParser
final void deserialize ()
 The method that deserializes the file information.
 GsonParser (String path)
 Creates a new GsonParser.
 GsonParser (String path, boolean log)
 Creates a new GsonParser.
void initialize (int size)
Public Member Functions inherited from com.runehive.util.parser.GenericParser
 GenericParser (String path, String extension, boolean log)
 Creates a new GenericParser.
final int getIndex ()
 Gets the current index of the line being parsed.
void onRead ()
 The method called after all the data has been parsed.
void run ()
String toString ()

Static Public Attributes

static Map< Integer, LoaderLOADED = new HashMap<>()

Protected Member Functions

void parse (JsonObject data)
 The method allows a user to modify the data as its being parsed.
Protected Member Functions inherited from com.runehive.util.parser.GsonParser
void onEnd ()
 This method handles what happens after the parser has ended.

Additional Inherited Members

Protected Attributes inherited from com.runehive.util.parser.GsonParser
transient Gson builder
 The Gson object.
Protected Attributes inherited from com.runehive.util.parser.GenericParser
int index
 The index of the current line being parsed.
final Path path
 The path of the file to parse.

Detailed Description

Definition at line 10 of file EquipmentParser.java.

Constructor & Destructor Documentation

◆ EquipmentParser()

com.runehive.util.parser.old.EquipmentParser.EquipmentParser ( )

Definition at line 14 of file EquipmentParser.java.

14 {
15 super("equip");
16 }

Member Function Documentation

◆ parse()

void com.runehive.util.parser.old.EquipmentParser.parse ( JsonObject data)
protected

The method allows a user to modify the data as its being parsed.

Parameters
dataThe JsonObject that contains all serialized information.

Reimplemented from com.runehive.util.parser.GsonParser.

Definition at line 19 of file EquipmentParser.java.

19 {
20 final int id = data.get("id").getAsInt();
21 SkillRequirement[] requirement = new SkillRequirement[] {};
22
23 if (data.has("requirements")) {
24 requirement = builder.fromJson(data.get("requirements"), SkillRequirement[].class);
25 }
26
27 LOADED.put(id, new Loader(id, requirement));
28 }

References com.runehive.util.parser.GsonParser.builder, and LOADED.

Member Data Documentation

◆ LOADED

Map<Integer, Loader> com.runehive.util.parser.old.EquipmentParser.LOADED = new HashMap<>()
static

Definition at line 12 of file EquipmentParser.java.

Referenced by parse().


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