Use new methods in other GameObject related debug classes

This commit is contained in:
Shadowrs
2018-10-05 19:12:28 +01:00
parent 5b7cfce082
commit 9f0950245b
6 changed files with 11 additions and 9 deletions
@@ -39,6 +39,8 @@ public class SceneObject implements Locatable {
/** /**
* Resolves the hash depending on the API's inner SceneObjectTile getHash() methods' type. * Resolves the hash depending on the API's inner SceneObjectTile getHash() methods' type.
* <br>This is strictly to be used only by Debug classes such as {@code DSceneObjects} due to the overhead of Reflection.
* In cases of high usage, classes should be duplicated as usual in a custom API with the required changed type.
* @return An object, casted to either Long or Int * @return An object, casted to either Long or Int
*/ */
public final Object resolveHash() { public final Object resolveHash() {
@@ -34,7 +34,7 @@ public class DSceneObjectsGroundDec extends AbstractDebugger {
if (enabled) { if (enabled) {
SceneObject[] objects = getGroundDecorations(); SceneObject[] objects = getGroundDecorations();
if (objects == null || objects.length == 0) { if (objects == null || objects.length == 0) {
Logger.addMessage("There are no GameObjects around you."); Logger.addMessage("There are no Ground Decorations around you.");
return; return;
} }
java.util.List<SceneObject> objs = Arrays.asList(objects); java.util.List<SceneObject> objs = Arrays.asList(objects);
@@ -44,7 +44,7 @@ public class DSceneObjectsGroundDec extends AbstractDebugger {
for (int i = objects.length - 1; i >= 0; i--) { for (int i = objects.length - 1; i >= 0; i--) {
System.out.println( System.out.println(
" ID: " + objects[i].getId() + " ID: " + objects[i].getId() +
" UID: " + objects[i].getHash() + " UID: " + objects[i].resolveHash() +
" Location: " + objects[i].getLocation() + " Location: " + objects[i].getLocation() +
" Distance: " + objects[i].distanceTo()); " Distance: " + objects[i].distanceTo());
} }
@@ -34,7 +34,7 @@ public class DSceneObjectsGroundItems extends AbstractDebugger {
if (enabled) { if (enabled) {
SceneObject[] objects = getGroundItems(); SceneObject[] objects = getGroundItems();
if (objects == null || objects.length == 0) { if (objects == null || objects.length == 0) {
Logger.addMessage("There are no GameObjects around you."); Logger.addMessage("There are no Ground Items around you.");
return; return;
} }
java.util.List<SceneObject> objs = Arrays.asList(objects); java.util.List<SceneObject> objs = Arrays.asList(objects);
@@ -44,7 +44,7 @@ public class DSceneObjectsGroundItems extends AbstractDebugger {
for (int i = objects.length - 1; i >= 0; i--) { for (int i = objects.length - 1; i >= 0; i--) {
System.out.println( System.out.println(
" ID: " + objects[i].getId() + " ID: " + objects[i].getId() +
" UID: " + objects[i].getHash() + " UID: " + objects[i].resolveHash() +
" Location: " + objects[i].getLocation() + " Location: " + objects[i].getLocation() +
" Distance: " + objects[i].distanceTo()); " Distance: " + objects[i].distanceTo());
} }
@@ -37,7 +37,7 @@ public class DSceneObjectsInteractiveObj extends AbstractDebugger {
if (enabled) { if (enabled) {
SceneObject[] objects = getInteractiveObjects(); SceneObject[] objects = getInteractiveObjects();
if (objects == null || objects.length == 0) { if (objects == null || objects.length == 0) {
Logger.addMessage("There are no GameObjects around you."); Logger.addMessage("There are no Interactive Objects around you.");
return; return;
} }
java.util.List<SceneObject> objs = Arrays.asList(objects); java.util.List<SceneObject> objs = Arrays.asList(objects);
@@ -34,7 +34,7 @@ public class DSceneObjectsWallDec extends AbstractDebugger {
if (enabled) { if (enabled) {
SceneObject[] objects = getWallDecorations(); SceneObject[] objects = getWallDecorations();
if (objects == null || objects.length == 0) { if (objects == null || objects.length == 0) {
Logger.addMessage("There are no GameObjects around you."); Logger.addMessage("There are no Wall Decorations around you.");
return; return;
} }
java.util.List<SceneObject> objs = Arrays.asList(objects); java.util.List<SceneObject> objs = Arrays.asList(objects);
@@ -44,7 +44,7 @@ public class DSceneObjectsWallDec extends AbstractDebugger {
for (int i = objects.length - 1; i >= 0; i--) { for (int i = objects.length - 1; i >= 0; i--) {
System.out.println( System.out.println(
" ID: " + objects[i].getId() + " ID: " + objects[i].getId() +
" UID: " + objects[i].getHash() + " UID: " + objects[i].resolveHash() +
" Location: " + objects[i].getLocation() + " Location: " + objects[i].getLocation() +
" Distance: " + objects[i].distanceTo()); " Distance: " + objects[i].distanceTo());
} }
@@ -34,7 +34,7 @@ public class DSceneObjectsWallObj extends AbstractDebugger {
if (enabled) { if (enabled) {
SceneObject[] objects = getWallObjects(); SceneObject[] objects = getWallObjects();
if (objects == null || objects.length == 0) { if (objects == null || objects.length == 0) {
Logger.addMessage("There are no GameObjects around you."); Logger.addMessage("There are no Wall Objects around you.");
return; return;
} }
java.util.List<SceneObject> objs = Arrays.asList(objects); java.util.List<SceneObject> objs = Arrays.asList(objects);
@@ -44,7 +44,7 @@ public class DSceneObjectsWallObj extends AbstractDebugger {
for (int i = objects.length - 1; i >= 0; i--) { for (int i = objects.length - 1; i >= 0; i--) {
System.out.println( System.out.println(
" ID: " + objects[i].getId() + " ID: " + objects[i].getId() +
" UID: " + objects[i].getHash() + " UID: " + objects[i].resolveHash() +
" Location: " + objects[i].getLocation() + " Location: " + objects[i].getLocation() +
" Distance: " + objects[i].distanceTo()); " Distance: " + objects[i].distanceTo());
} }