From c8cc7a5cd219b494a6dce4cc6156495af963639a Mon Sep 17 00:00:00 2001 From: Major- Date: Thu, 11 Sep 2014 21:29:52 +0100 Subject: [PATCH] Rename height field of ObjectDefinition to length. --- data/plugins/cmd/lookup/lookup.rb | 2 +- .../fs/decoder/ObjectDefinitionDecoder.java | 2 +- .../game/model/def/ObjectDefinition.java | 23 +++++++++---------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/data/plugins/cmd/lookup/lookup.rb b/data/plugins/cmd/lookup/lookup.rb index 9e0f1ee7..c145a59b 100644 --- a/data/plugins/cmd/lookup/lookup.rb +++ b/data/plugins/cmd/lookup/lookup.rb @@ -60,5 +60,5 @@ on :command, :objectinfo, RIGHTS_ADMIN do |player, command| id = args[0].to_i definition = ObjectDefinition.lookup(id) player.send_message("Object #{id} is called #{definition.name} and its description is \"#{definition.description}\".") - player.send_message("Its width is #{definition.width} and its height is #{definition.height}.") + player.send_message("Its width is #{definition.width} and its length is #{definition.length}.") end \ No newline at end of file diff --git a/src/org/apollo/fs/decoder/ObjectDefinitionDecoder.java b/src/org/apollo/fs/decoder/ObjectDefinitionDecoder.java index 890cb49d..b828f76e 100644 --- a/src/org/apollo/fs/decoder/ObjectDefinitionDecoder.java +++ b/src/org/apollo/fs/decoder/ObjectDefinitionDecoder.java @@ -87,7 +87,7 @@ public final class ObjectDefinitionDecoder { } else if (opcode == 14) { definition.setWidth(data.get() & 0xFF); } else if (opcode == 15) { - definition.setHeight(data.get() & 0xFF); + definition.setLength(data.get() & 0xFF); } else if (opcode == 17) { definition.setSolid(false); } else if (opcode == 18) { diff --git a/src/org/apollo/game/model/def/ObjectDefinition.java b/src/org/apollo/game/model/def/ObjectDefinition.java index 8925dd61..67e058cf 100644 --- a/src/org/apollo/game/model/def/ObjectDefinition.java +++ b/src/org/apollo/game/model/def/ObjectDefinition.java @@ -57,8 +57,7 @@ public final class ObjectDefinition { */ public static ObjectDefinition lookup(int id) { if (id < 0 || id > definitions.length) { - throw new IndexOutOfBoundsException(ObjectDefinition.class.getName() + " lookup index " + id - + " out of bounds."); + throw new IndexOutOfBoundsException(ObjectDefinition.class.getName() + " lookup index " + id + " out of bounds."); } return definitions[id]; } @@ -69,9 +68,9 @@ public final class ObjectDefinition { private String description; /** - * This object's height. + * This object's length. */ - private int height; + private int length; /** * The object's id. @@ -127,12 +126,12 @@ public final class ObjectDefinition { } /** - * Gets the height of this object. + * Gets the length of this object. * - * @return The height. + * @return The length. */ - public int getHeight() { - return height; + public int getLength() { + return length; } /** @@ -208,12 +207,12 @@ public final class ObjectDefinition { } /** - * Sets the height of this object. + * Sets the length of this object. * - * @param height The height. + * @param length The length. */ - public void setHeight(int height) { - this.height = height; + public void setLength(int length) { + this.length = length; } /**