RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
GameObjectDefinition.java
1package com.osroyale.game.world.object;
2
41
43
45 public static final int MAX_DEFINITIONS = 47501;
46
49
56
57
58 public static void addDefinition(GameObjectDefinition def) {
59 definitions[def.getId()] = def;
60 }
61
69 public static GameObjectDefinition forId(int id) {
70 if (id < 0 || id >= definitions.length) {
71 return null;
72 }
73 return definitions[id];
74 }
75
77 private int id;
78
80 private String name;
81
83 private String desc;
84
86 private int width;
87
89 private int length;
93 private int distance = 1;
94
96 private boolean solid;
97
99 private boolean impenetrable;
100
102 private boolean hasActions;
103
105 private final boolean wall;
106
108 private final boolean decoration;
109
110 private final int walkingFlag;
111
113 public GameObjectDefinition(int id, String name, String desc, int width, int length, int distance, boolean solid, boolean impenetrable, boolean hasActions, boolean wall, boolean decoration, int walkingFlag) {
114 this.id = id;
115 this.name = name;
116 this.desc = desc;
117 this.width = width;
118 this.length = length;
119 this.distance = distance;
120 this.solid = solid;
121 this.impenetrable = impenetrable;
122 this.hasActions = hasActions;
123 this.wall = wall;
124 this.decoration = decoration;
125 this.walkingFlag = walkingFlag;
126 }
127
129 public int getId() {
130 return this.id;
131 }
132
134 public String getName() {
135 return name;
136 }
137
139 public String getDescription() {
140 return desc;
141 }
142
144 public int getWidth() {
145 return width;
146 }
147
149 public int getLength() {
150 return length;
151 }
152
153 public int getDistance() {
154 return distance;
155 }
156
158 public boolean isSolid() {
159 return solid;
160 }
161
163 public boolean isImpenetrable() {
164 return impenetrable;
165 }
166
168 public boolean hasActions() {
169 return hasActions;
170 }
171
172 public boolean isWall() {
173 return wall;
174 }
175
176 public boolean isDecoration() {
177 return decoration;
178 }
179
180 public int getWalkingFlag() {
181 return walkingFlag;
182 }
183
184 @Override
185 public String toString() {
186 return String.format("[id=%s, name=%s, width=%s, length=%s, distance=%s, wall=%s, impenetrable=%s, solid=%s", id, name, width, length, distance, wall, impenetrable, solid);
187 }
188}
GameObjectDefinition(int id, String name, String desc, int width, int length, int distance, boolean solid, boolean impenetrable, boolean hasActions, boolean wall, boolean decoration, int walkingFlag)
static void addDefinition(GameObjectDefinition def)