RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
EquipmentDefinition.java
1package com.osroyale.util.parser.old.defs;
2
3import com.osroyale.game.world.items.SkillRequirement;
4import com.osroyale.game.world.items.containers.equipment.EquipmentType;
5
6import java.util.HashMap;
7import java.util.Map;
8
45
46public class EquipmentDefinition {
47
48 /* The id of the item */
49 private final int id;
50
51 /* The name of the item */
52 private final String name;
53
54 /* The type of equipment also called slot */
55 private final EquipmentType type;
56
57 /* The requirements to equip this item */
58 private final SkillRequirement[] requirements;
59
60 /* The bonuses for this item */
61 private final int[] bonuses;
62
72 public EquipmentDefinition(int id, String name, EquipmentType type, SkillRequirement[] requirements, int[] bonuses) {
73 this.id = id;
74 this.name = name;
75 this.type = type;
76 this.requirements = requirements;
77 this.bonuses = bonuses;
78 }
79
81 public int[] getBonuses() {
82 return bonuses;
83 }
84
86 public int getId() {
87 return id;
88 }
89
93 public String getName() {
94 return name;
95 }
96
99 return requirements;
100 }
101
104 return type;
105 }
106
108 public int getSlot() {
109 return getType().getSlot();
110 }
111
112 /* The equipment definitions stored on startup that are mapped to their item ids */
113 public static final Map<Integer, EquipmentDefinition> EQUIPMENT_DEFINITIONS = new HashMap<>();
114
115 public static EquipmentDefinition get(int id) {
116 return EQUIPMENT_DEFINITIONS.get(id);
117 }
118
119}
EquipmentDefinition(int id, String name, EquipmentType type, SkillRequirement[] requirements, int[] bonuses)