From: <chr...@us...> - 2006-10-01 22:17:49
|
Revision: 443 http://svn.sourceforge.net/gridarta/?rev=443&view=rev Author: christianhujer Date: 2006-10-01 15:17:42 -0700 (Sun, 01 Oct 2006) Log Message: ----------- Fixed bogus description of calculateEditType(). Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-01 22:15:08 UTC (rev 442) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-01 22:17:42 UTC (rev 443) @@ -159,9 +159,9 @@ /** * Get the EditType of an GameObject (e.g. floor, monster, etc). These are - * determined by the various attributes of the arch (->objectText). + * determined by the various attributes of the GameObject (->objectText). * @param checkType bitmask containing the edit type(s) to be calculated - * @return new editType for this arch + * @return new editType for this GameObject */ int calculateEditType(int checkType); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-01 22:51:04
|
Revision: 445 http://svn.sourceforge.net/gridarta/?rev=445&view=rev Author: christianhujer Date: 2006-10-01 15:50:54 -0700 (Sun, 01 Oct 2006) Log Message: ----------- Improved documentation: More links. Added more common implementation methods to interface. Changed method order to be more logical. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-01 22:31:26 UTC (rev 444) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-01 22:50:54 UTC (rev 445) @@ -58,6 +58,7 @@ * @param attributeName Name of the attribute to search. * @param queryArchetype Whether to query the Archetype of this GameObject. * @return attribute value or zero if not found. + * @see #getAttributeInt(String) * @see #getAttributeString(String, boolean) */ int getAttributeInt(@NotNull String attributeName, boolean queryArchetype); @@ -66,15 +67,17 @@ * Get the requested attribute value of this GameObject as <code>int</code>. * @param attributeName Name of the attribute to search. * @return Attribute value or zero if not found + * @see #getAttributeInt(String, boolean) * @see #getAttributeString(String) */ int getAttributeInt(@NotNull String attributeName); /** - * Get the requested attribute value of this GameObject as <code>int</code>. + * Get the requested attribute value of this GameObject as <code>long</code>. * @param attributeName Name of the attribute to search. * @param queryArchetype Whether to query the Archetype of this GameObject. * @return attribute value or zero if not found. + * @see #getAttributeLong(String) * @see #getAttributeString(String, boolean) */ long getAttributeLong(@NotNull String attributeName, boolean queryArchetype); @@ -83,6 +86,7 @@ * Get the requested attribute value of this GameObject as <code>long</code>. * @param attributeName Name of the attribute to search. * @return Attribute value or zero if not found + * @see #getAttributeLong(String, boolean) * @see #getAttributeString(String) */ long getAttributeLong(@NotNull String attributeName); @@ -92,6 +96,7 @@ * @param attributeName Name of the attribute to search. * @param queryArchetype Whether to query the Archetype of this GameObject. * @return attribute value or zero if not found. + * @see #getAttributeDouble(String) * @see #getAttributeString(String, boolean) */ double getAttributeDouble(@NotNull String attributeName, boolean queryArchetype); @@ -100,6 +105,7 @@ * Get the requested attribute value of this GameObject as <code>double</code>. * @param attributeName Name of the attribute to search. * @return attribute value or zero if not found. + * @see #getAttributeDouble(String, boolean) * @see #getAttributeString(String) */ double getAttributeDouble(@NotNull String attributeName); @@ -112,6 +118,7 @@ * <li>A MapSquare, which means that this GameObject is top level on that MapSquare (Crossfire returns <code>null</code> for this).</li> * </ul> * @return container of this GameObject. + * @see #getTopContainer() */ @Nullable Object getContainer(); // todo: change return type to something more specific. @@ -120,33 +127,49 @@ * means being in a MapSquare isn't, but being in an GameObject is). * @return the topmost container but always GameObject, never MapSquare. * If this object is topmost itself, it returns itself. + * @see #getContainer() */ @NotNull GameObject getTopContainer(); /** * Get the Archetype this GameObject is based on. * @return Archetype this GameObject is based on. + * @note For Archetypes, this method returns <code>thus</code>. * @note currently this method returns the GameObject that reflects the Archetype data because there is no separate Archetype class. * This will change in future, and you should be aware of this fact. + * @see #isArchetype() + * @see #setArchetype(GameObject) */ @NotNull GameObject getArchetype(); /** + * Returns whether this GameObject is an Archetype. + * @return <code>true</code> if this GameObject is an Archetype, otherwise <code>false</code> + * @see #getArchetype() + * @see #setArchetype(GameObject) + * @see #isArtifact() + */ + boolean isArchetype(); + + /** * Set the Archetype of this GameObject. * @param archetype new Archetype of this GameObject. * @note currently this method takes a GameObject that reflects the Archetype data because there is no separate Archetype class. * This will change in future, and you should be aware of this fact. + * @see #getArchetype() * @see #isArchetype() */ void setArchetype(@NotNull final GameObject archetype); /** - * Returns whether this GameObject is an Archetype. - * @return <code>true</code> if this GameObject is an Archetype, otherwise <code>false</code> - * @see #isArtifact() - * @see #setArchetype(GameObject) + * Returns whether this GameObject is an Artifact. + * Artifacts are special forms of Archetypes, and they are excluded from Archetypes collection. + * @return <code>true</code> if this GameObject is an Artifact, otherwise <code>false</code>. + * @invariant if this method returns <code>true</code>, {@link #isArchetype()} also returns <code>true</code>. + * @see #setArtifact(boolean) + * @see #isArchetype() */ - boolean isArchetype(); + boolean isArtifact(); /** * Sets whether this GameObject is an Artifact. @@ -156,33 +179,47 @@ void setArtifact(boolean artifact); /** - * Returns whether this GameObject is an Artifact. - * Artifacts are special forms of Archetypes, and they are excluded from Archetypes collection. - * @return <code>true</code> if this GameObject is an Artifact, otherwise <code>false</code>. - * @invariant if this method returns <code>true</code>, {@link #isArchetype()} also returns <code>true</code>. - * @see #isArchetype() - * @see #setArtifact(boolean) + * Get the EditType of an GameObject (e.g. floor, monster, etc). These are + * determined by the various attributes of the GameObject (->objectText). + * @param checkType bitmask containing the edit type(s) to be calculated + * @return new editType for this GameObject + * @see #getEditType() + * @see #setEditType(int) */ - boolean isArtifact(); + int calculateEditType(int checkType); /** * Returns the edit type. * @return edit type + * @see #calculateEditType(int) + * @see #setEditType(int) */ int getEditType(); /** * Sets the edit type of this GameObject. * @param editType edit type of this GameObject. + * @see #calculateEditType(int) + * @see #getEditType() */ void setEditType(int editType); /** - * Get the EditType of an GameObject (e.g. floor, monster, etc). These are - * determined by the various attributes of the GameObject (->objectText). - * @param checkType bitmask containing the edit type(s) to be calculated - * @return new editType for this GameObject + * Get the X coordinate of this GameObject on its map. + * This method only guarantees a reasonable value for GameObjects that are directly bound to a map. + * Implementations may also return reasonable values for GameObjects inside containers, but they are not required to do so. + * @return X coordinate on map + * @see #getMapY() */ - int calculateEditType(int checkType); + int getMapX(); + /** + * Get the Y coordinate of this GameObject on its map. + * This method only guarantees a reasonable value for GameObjects that are directly bound to a map. + * Implementations may also return reasonable values for GameObjects inside containers, but they are not required to do so. + * @return Y coordinate on map + * @see #getMapX() + */ + int getMapY(); + } // interface GameObject This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-07 11:17:55
|
Revision: 481 http://svn.sourceforge.net/gridarta/?rev=481&view=rev Author: christianhujer Date: 2006-10-07 04:17:50 -0700 (Sat, 07 Oct 2006) Log Message: ----------- Clarified documentation of createArch(). Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-06 19:54:47 UTC (rev 480) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-07 11:17:50 UTC (rev 481) @@ -232,6 +232,8 @@ /** * Create a new GameObject from this Archetype. * If this GameObject is not an Archetype, this method recursively forwards to its Archetype. + * This means that the newly created GameObject will not reflect any differences / attributes specific to this GameObject. + * The newly created GameObject will be based on the Archetype only. * @return new GameObject */ GameObject createArch(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-07 11:25:27
|
Revision: 482 http://svn.sourceforge.net/gridarta/?rev=482&view=rev Author: christianhujer Date: 2006-10-07 04:25:23 -0700 (Sat, 07 Oct 2006) Log Message: ----------- Clarified documentation of getMapX() and getMapY(). Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-07 11:17:50 UTC (rev 481) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-07 11:25:23 UTC (rev 482) @@ -213,7 +213,7 @@ /** * Get the X coordinate of this GameObject on its map. - * This method only guarantees a reasonable value for GameObjects that are directly bound to a map. + * This method only guarantees a reasonable value for GameObjects that are directly bound to a map (i.e. {@link #getTopContainer()} returns <code>null</code>). * Implementations may also return reasonable values for GameObjects inside containers, but they are not required to do so. * @return X coordinate on map * @see #getMapY() @@ -222,7 +222,7 @@ /** * Get the Y coordinate of this GameObject on its map. - * This method only guarantees a reasonable value for GameObjects that are directly bound to a map. + * This method only guarantees a reasonable value for GameObjects that are directly bound to a map (i.e. {@link #getTopContainer()} returns <code>null</code>). * Implementations may also return reasonable values for GameObjects inside containers, but they are not required to do so. * @return Y coordinate on map * @see #getMapX() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-26 19:53:34
|
Revision: 1727 http://svn.sourceforge.net/gridarta/?rev=1727&view=rev Author: christianhujer Date: 2007-01-26 11:53:30 -0800 (Fri, 26 Jan 2007) Log Message: ----------- Flipped comparison so IntelliJ IDEA knows there's no NPE. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-26 19:50:24 UTC (rev 1726) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-26 19:53:30 UTC (rev 1727) @@ -989,7 +989,7 @@ && (gameObject.archetypeName == null ? archetypeName == null : gameObject.archetypeName.equals(archetypeName)) && (gameObject.objName == null ? objName == null : gameObject.objName.equals(objName)) && gameObject.objectText.toString().equals(objectText.toString()) - && (gameObject.msgText == null ? msgText == null : msgText != null && gameObject.msgText.toString().equals(msgText.toString())) + && (gameObject.msgText == null ? msgText == null : msgText != null && msgText.toString().equals(gameObject.msgText.toString())) // ignore "mapx" // ignore "mapy" // ignore "attributeCache" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-04-09 14:48:51
|
Revision: 2184 http://svn.sourceforge.net/gridarta/?rev=2184&view=rev Author: akirschbaum Date: 2007-04-09 07:48:52 -0700 (Mon, 09 Apr 2007) Log Message: ----------- Improve performance: compile regex only once. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-04-09 14:38:59 UTC (rev 2183) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-04-09 14:48:52 UTC (rev 2184) @@ -21,6 +21,7 @@ import java.util.HashMap; import java.util.Map; +import java.util.regex.Pattern; import net.sf.gridarta.CFArchTypeList; import net.sf.gridarta.map.MapArchObject; import net.sf.gridarta.map.MapSquare; @@ -126,6 +127,11 @@ private String editorFolder; /** + * Pattern to match end of lines. + */ + private static final Pattern patternEndOfLine = Pattern.compile("\\s*\n"); + + /** * Constructor. */ protected GameObject() { @@ -186,7 +192,7 @@ @Nullable private String getAttributeValue(@NotNull final String attributeName) { final String attr2 = attributeName.trim() + ' '; String result = null; - for (final String line : getObjectText().split("\\s*\n")) { + for (final String line : patternEndOfLine.split(getObjectText(), 0)) { if (line.startsWith(attr2)) { result = line.substring(attr2.length()); break; @@ -1076,7 +1082,7 @@ */ @NotNull public String diffArchText(@NotNull final String atxt, final boolean ignoreValues) { final StringBuilder result = new StringBuilder(); - for (final String line : atxt.split("\\s*\n")) { + for (final String line : patternEndOfLine.split(atxt, 0)) { if (ignoreValues) { final int spaceIndex = line.indexOf(" "); if (line.length() > 0 && spaceIndex > 0 && diffTextString(getObjectText(), line.substring(0, spaceIndex + 1), ignoreValues) == null) { @@ -1113,7 +1119,7 @@ */ /** {@inheritDoc} */ @Nullable private static String diffTextString(final String argBase, final String str, final boolean ignoreValues) { - for (final String line : argBase.split("\n")) { + for (final String line : patternEndOfLine.split(argBase, 0)) { if (ignoreValues ? line.startsWith(str) : line.equals(str)) { return line; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-08 23:44:52
|
Revision: 510 http://svn.sourceforge.net/gridarta/?rev=510&view=rev Author: christianhujer Date: 2006-10-08 16:44:48 -0700 (Sun, 08 Oct 2006) Log Message: ----------- Comments about bogus nullability of msgText. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-08 23:38:11 UTC (rev 509) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-08 23:44:48 UTC (rev 510) @@ -541,6 +541,7 @@ /** Delete message text by nullification. */ public void deleteMsgText() { + // FIXME, see addMsgText for information msgText = null; } @@ -549,7 +550,6 @@ if (msgText == null) { return; } - msgText.delete(0, msgText.length()); } @@ -559,18 +559,17 @@ * <code>null</code> creates an empty string. * @param text text to append to message text */ - public void addMsgText(final String text) { + public void addMsgText(@Nullable final String text) { + // It's intentional that if text == null, msgText still is created if it's empty. + // FIXME: Though it's intentional, it's not nice, search for users and fix this. + // (Also look at deleteMsgText() and getMsgText() then) if (msgText == null) { msgText = new StringBuffer(); } - if (text == null) { - // special, this adds a clear string - // That's why it's after checking msgText for null. - return; + if (text != null) { + msgText.append(text); } - - msgText.append(text); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 08:25:21
|
Revision: 513 http://svn.sourceforge.net/gridarta/?rev=513&view=rev Author: christianhujer Date: 2006-10-09 01:25:16 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Added check for artifacts always are archetypes invariant. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:17:02 UTC (rev 512) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:25:16 UTC (rev 513) @@ -507,9 +507,13 @@ /** * Sets whether this GameObject is an Artifact. * @param artifact <code>true</code> if this GameObject is an Artifact, otherwise <code>false</code>. + * @throws NotArchetypeException in case this GameObject is not an Archetype. * @see #isArtifact() */ public void setArtifact(final boolean artifact) { + if (!isArchetype()) { + throw new NotArchetypeException(this); + } this.artifact = artifact; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 08:36:48
|
Revision: 516 http://svn.sourceforge.net/gridarta/?rev=516&view=rev Author: christianhujer Date: 2006-10-09 01:36:43 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Removed TODO comments of a TODO that's already done. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:34:08 UTC (rev 515) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:36:43 UTC (rev 516) @@ -343,12 +343,6 @@ return container != null ? container.getMapSquare() : null; } - // TODO: For the following set of methods add logging that it was tried to move a GameObject without container. - // TODO (continued): Eventually think about using an Exception for that case. - // TODO (continued): Or two: - // TODO (continued): * One in case a non-Archetype method was invoked on an Archetype. - // TODO (continued): * The other in case a method that requires a container was invoked on a GameObject without container. - /** * Move this GameObject top. * Does nothing if the object has no container. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 10:27:39
|
Revision: 523 http://svn.sourceforge.net/gridarta/?rev=523&view=rev Author: christianhujer Date: 2006-10-09 03:27:32 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Changed getBetsName() to use Archetype methods. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 10:24:17 UTC (rev 522) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 10:27:32 UTC (rev 523) @@ -708,15 +708,15 @@ * @return best suitable descriptive name */ public String getBestName() { - final GameObject archetype = getArchetype(); + final Archetype<G> archetype = getArchetype(); if (objName != null && objName.length() > 0) { return objName; - } else if (archetype != null && archetype.objName != null && archetype.objName.length() > 0) { - return archetype.objName; + } else if (archetype != null && archetype.getObjName() != null && archetype.getObjName().length() > 0) { + return archetype.getObjName(); } else if (archetypeName != null && archetypeName.length() > 0) { return archetypeName; - } else if (archetype != null && archetype.archetypeName != null) { - return archetype.archetypeName; + } else if (archetype != null && archetype.getArchetypeName() != null) { + return archetype.getArchetypeName(); } return "???"; // this case should actually never happen } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-05 12:16:30
|
Revision: 613 http://svn.sourceforge.net/gridarta/?rev=613&view=rev Author: christianhujer Date: 2006-11-05 04:16:18 -0800 (Sun, 05 Nov 2006) Log Message: ----------- Cosmetic changes. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-11-05 12:15:50 UTC (rev 612) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-11-05 12:16:18 UTC (rev 613) @@ -54,7 +54,7 @@ * The msgText. * @note Every line in msgText must end on '\n', including the last line. * @note If the value is <code>null</code>, this GameObject has no message text, - * if the value exists but is empty, this GameObject has an empty message text (unconfirmed). + * if the value exists but is empty, this GameObject has an empty message text. */ @Nullable protected StringBuffer msgText; @@ -152,6 +152,7 @@ } return result; } + /** * Get the requested attribute value of this GameObject as {@link String}. * The attribute value is first searched in this GameObject. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-06 21:04:05
|
Revision: 621 http://svn.sourceforge.net/gridarta/?rev=621&view=rev Author: christianhujer Date: 2006-11-06 13:03:52 -0800 (Mon, 06 Nov 2006) Log Message: ----------- Cosmetic: Added missing blank line. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-11-06 00:06:19 UTC (rev 620) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-11-06 21:03:52 UTC (rev 621) @@ -609,6 +609,7 @@ @Nullable public String getMsgText() { return msgText != null ? msgText.toString() : null; } + /** * Get the X coordinate of this GameObject on its map. * This method only guarantees a reasonable value for GameObjects that are directly bound to a map (i.e. {@link #getTopContainer()} returns <code>null</code>). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-11-21 21:40:29
|
Revision: 681 http://svn.sourceforge.net/gridarta/?rev=681&view=rev Author: christianhujer Date: 2006-11-21 13:40:28 -0800 (Tue, 21 Nov 2006) Log Message: ----------- Fixed typo. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-11-21 21:34:13 UTC (rev 680) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-11-21 21:40:28 UTC (rev 681) @@ -439,7 +439,7 @@ /** * Get the Archetype this GameObject is based on. * @return Archetype this GameObject is based on. - * @note For Archetypes, this method returns <code>thus</code>. + * @note For Archetypes, this method returns <code>this</code>. * @note currently this method returns the GameObject that reflects the Archetype data because there is no separate Archetype class. * This will change in future, and you should be aware of this fact. * @see #isArchetype() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-10 22:09:57
|
Revision: 1047 http://svn.sourceforge.net/gridarta/?rev=1047&view=rev Author: christianhujer Date: 2006-12-10 14:09:57 -0800 (Sun, 10 Dec 2006) Log Message: ----------- Minor improvements. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-12-10 21:54:22 UTC (rev 1046) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-12-10 22:09:57 UTC (rev 1047) @@ -680,10 +680,8 @@ public abstract G getHead(); /** - * Determine if this part is the head part. For single-part objects this is - * always true. - * - * @return <code>true</code> iff this part if a head part + * Returns whether this object is a single-part object or the head of the multi-part object. + * @return <code>true</code> if single-part or head of multi-part, otherwise <code>false</code>. */ public boolean isHead() { return getHead() == this; @@ -740,10 +738,11 @@ */ public String getBestName() { final Archetype<G> archetype = getArchetype(); + final String archObjName = archetype.getObjName(); if (objName != null && objName.length() > 0) { return objName; - } else if (archetype.getObjName() != null && archetype.getObjName().length() > 0) { - return archetype.getObjName(); + } else if (archObjName != null && archObjName.length() > 0) { + return archObjName; } else if (archetypeName != null && archetypeName.length() > 0) { return archetypeName; } else if (archetype.getArchetypeName() != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-10 21:06:05
|
Revision: 1540 http://svn.sourceforge.net/gridarta/?rev=1540&view=rev Author: akirschbaum Date: 2007-01-10 13:05:55 -0800 (Wed, 10 Jan 2007) Log Message: ----------- Properly clear attribute cache and fire square changed event when the object text changes. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-10 08:28:24 UTC (rev 1539) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-10 21:05:55 UTC (rev 1540) @@ -923,6 +923,8 @@ if (!line.endsWith("\n")) { objectText.append('\n'); } + clearAttributeCache(); + squareChanged(); } /** Clears the object text of this GameObject. */ @@ -932,6 +934,7 @@ } objectText.delete(0, objectText.length()); + clearAttributeCache(); squareChanged(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-25 21:38:19
|
Revision: 1710 http://svn.sourceforge.net/gridarta/?rev=1710&view=rev Author: akirschbaum Date: 2007-01-25 13:38:16 -0800 (Thu, 25 Jan 2007) Log Message: ----------- Remove obsolete comments. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-25 21:31:44 UTC (rev 1709) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-25 21:38:16 UTC (rev 1710) @@ -490,8 +490,6 @@ * Get the Archetype this GameObject is based on. * @return Archetype this GameObject is based on. * @note For Archetypes, this method returns <code>this</code>. - * @note currently this method returns the GameObject that reflects the Archetype data because there is no separate Archetype class. - * This will change in future, and you should be aware of this fact. * @see #isArchetype() * @see #setArchetype(Archetype) */ @@ -533,8 +531,6 @@ /** * Set the Archetype of this GameObject. * @param archetype new Archetype of this GameObject. - * @note currently this method takes a GameObject that reflects the Archetype data because there is no separate Archetype class. - * This will change in future, and you should be aware of this fact. * @see #getArchetype() * @see #isArchetype() */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-02-06 22:16:42
|
Revision: 1861 http://svn.sourceforge.net/gridarta/?rev=1861&view=rev Author: christianhujer Date: 2007-02-06 14:07:22 -0800 (Tue, 06 Feb 2007) Log Message: ----------- Fixed javadoc bug. Suppressed warning about abstract method overriding abstract method - in this case, that's okay. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-02-06 22:07:04 UTC (rev 1860) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-02-06 22:07:22 UTC (rev 1861) @@ -489,6 +489,8 @@ } /** {@inheritDoc} */ + // The warning is only there as long as GameObject extends Archetype. + @SuppressWarnings({"AbstractMethodOverridesAbstractMethod"}) public abstract int getArchTypNr(); /** @@ -1085,7 +1087,7 @@ * returns the full line where 'str' occurs in base. * Only occurrences of 'str' at the beginning of a new line are counted as valid. * If not found, null is returned. - * @param base full text to search + * @param argBase full text to search * @param str string (attribute) to look for * @param ignoreValues if true, lines are matched against 'str' only till the first space (" ") * @return The text that differs. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-04-09 15:10:31
|
Revision: 2189 http://svn.sourceforge.net/gridarta/?rev=2189&view=rev Author: akirschbaum Date: 2007-04-09 08:10:29 -0700 (Mon, 09 Apr 2007) Log Message: ----------- Improve performance: compile regex only once. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-04-09 15:08:43 UTC (rev 2188) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-04-09 15:10:29 UTC (rev 2189) @@ -345,7 +345,7 @@ boolean exists = false; final StringBuilder result = new StringBuilder(); - for (final String line : getObjectText().split("\\s*\n")) { + for (final String line : patternEndOfLine.split(getObjectText(), 0)) { if (!line.startsWith(attributeNameWithSpace)) { result.append(line).append('\n'); } else { @@ -367,7 +367,7 @@ final String attributeNameWithSpace = attributeName.trim() + " "; // attributeName must be followed by space final StringBuilder sb = new StringBuilder(); - for (final String line : getObjectText().split("\\s*\n")) { + for (final String line : patternEndOfLine.split(getObjectText(), 0)) { if (!line.startsWith(attributeNameWithSpace)) { sb.append(line).append('\n'); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-05-19 15:42:57
|
Revision: 2622 http://svn.sourceforge.net/gridarta/?rev=2622&view=rev Author: christianhujer Date: 2007-05-19 08:42:58 -0700 (Sat, 19 May 2007) Log Message: ----------- Some cleanup, fixed lots of warnings and some possible NPEs, especially due to race conditions. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-05-19 15:34:24 UTC (rev 2621) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-05-19 15:42:58 UTC (rev 2622) @@ -399,7 +399,7 @@ boolean exists = false; final StringBuilder result = new StringBuilder(); for (final String line : patternEndOfLine.split(getObjectText(), 0)) { - if (line.equals("")) { + if (line.length() == 0) { // skip empty lines that occur due to split on empty object texts. } else if (!line.startsWith(attributeNameWithSpace)) { result.append(line).append('\n'); @@ -457,7 +457,7 @@ final G topContainer; if (isInContainer()) { assert container != null; - topContainer = ((G) container).getTopContainer(); + topContainer = ((GameObject<G, A, R>) container).getTopContainer(); } else { topContainer = (G) this; } @@ -579,16 +579,24 @@ * Insert a GameObject before this GameObject. * @param node GameObject to append */ - public void insertBefore(final G node) { - getContainer().insertBefore(node, (G) this); + public void insertBefore(@NotNull final G node) { + final GameObjectContainer container = getContainer(); + if (container == null) { + throw new NotInsideContainerException(null, this); + } + container.insertBefore(node, this); } /** * Insert a GameObject after this GameObject. * @param node GameObject to append */ - public void insertAfter(final G node) { - getContainer().insertAfter((G) this, node); + public void insertAfter(@NotNull final G node) { + final GameObjectContainer container = getContainer(); + if (container == null) { + throw new NotInsideContainerException(null, this); + } + container.insertAfter(this, node); } /** @@ -830,15 +838,17 @@ // It's intentional that if text == null, msgText still is created if it's empty. // FIXME: Though it's intentional, it's not nice, search for users and fix this. // (Also look at deleteMsgText() and getMsgText() then) - if (msgText == null) { - msgText = new StringBuilder(); + StringBuilder myMsgText = msgText; + if (myMsgText == null) { + myMsgText = new StringBuilder(); + msgText = myMsgText; isChanged = true; } if (text != null) { final String trimmedText = patternTrailingWhitespace.matcher(text).replaceAll(""); if (trimmedText.length() > 0) { - msgText.append(trimmedText); + myMsgText.append(trimmedText); isChanged = true; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-05-19 17:22:51
|
Revision: 2634 http://svn.sourceforge.net/gridarta/?rev=2634&view=rev Author: christianhujer Date: 2007-05-19 10:22:53 -0700 (Sat, 19 May 2007) Log Message: ----------- Removed bogus @Override annotation. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-05-19 17:14:38 UTC (rev 2633) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-05-19 17:22:53 UTC (rev 2634) @@ -163,7 +163,7 @@ } /** {@inheritDoc} */ - @Override public int getArchTypNr() { + public int getArchTypNr() { return archType; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-09-08 14:41:10
|
Revision: 2970 http://gridarta.svn.sourceforge.net/gridarta/?rev=2970&view=rev Author: akirschbaum Date: 2007-09-08 07:41:11 -0700 (Sat, 08 Sep 2007) Log Message: ----------- Remove some raw types. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-09-08 14:35:22 UTC (rev 2969) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-09-08 14:41:11 UTC (rev 2970) @@ -580,11 +580,11 @@ * @param node GameObject to append */ public void insertBefore(@NotNull final G node) { - final GameObjectContainer container = getContainer(); + final GameObjectContainer<G, A, R> container = getContainer(); if (container == null) { throw new NotInsideContainerException(this); } - container.insertBefore(node, this); + container.insertBefore(node, (G) this); } /** @@ -592,11 +592,11 @@ * @param node GameObject to append */ public void insertAfter(@NotNull final G node) { - final GameObjectContainer container = getContainer(); + final GameObjectContainer<G, A, R> container = getContainer(); if (container == null) { throw new NotInsideContainerException(this); } - container.insertAfter(this, node); + container.insertAfter((G) this, node); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-10-27 19:24:23
|
Revision: 3242 http://gridarta.svn.sourceforge.net/gridarta/?rev=3242&view=rev Author: akirschbaum Date: 2007-10-27 12:24:27 -0700 (Sat, 27 Oct 2007) Log Message: ----------- Remove raw type. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-10-27 19:18:10 UTC (rev 3241) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-10-27 19:24:27 UTC (rev 3242) @@ -205,7 +205,7 @@ */ public int countInvObjects() { int count = 0; - for (final GameObject gameObject : this) { + for (final G gameObject : this) { count++; count += gameObject.countInvObjects(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-02-23 10:24:25
|
Revision: 3594 http://gridarta.svn.sourceforge.net/gridarta/?rev=3594&view=rev Author: akirschbaum Date: 2008-02-23 02:23:59 -0800 (Sat, 23 Feb 2008) Log Message: ----------- Performance improvements. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-02-23 10:20:35 UTC (rev 3593) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-02-23 10:23:59 UTC (rev 3594) @@ -1397,9 +1397,10 @@ final CFArchType type = archType != null ? archType : typeList.getTypeOfArch(this); final StringBuilder errors = new StringBuilder(); // return value: all error lines - for (final String line : getObjectText().split("\\s*\n")) { + for (final String line : patternEndOfLine.split(getObjectText())) { // get only the key-part of the attribute. - final String attrKey = line.contains(" ") ? line.substring(0, line.indexOf(" ")) : line; + final int spaceIndex = line.indexOf(' '); + final String attrKey = spaceIndex != -1 ? line.substring(0, spaceIndex) : line; // now check if there's a match in the definitions boolean doesMatch = false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-03-21 15:59:09
|
Revision: 3711 http://gridarta.svn.sourceforge.net/gridarta/?rev=3711&view=rev Author: akirschbaum Date: 2008-03-21 08:57:11 -0700 (Fri, 21 Mar 2008) Log Message: ----------- Remove redundant call to String.toString(). Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-03-21 15:53:42 UTC (rev 3710) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-03-21 15:57:11 UTC (rev 3711) @@ -1199,7 +1199,7 @@ && (archetypeName == null ? false : archetypeName.equals(archetype.getArchetypeName())) && (objName == null || objName.equals(archetype.getObjName())) && objectText.toString().length() <= 0 - && (msgText == null || msgText.toString().equals(archetype.getMsgText().toString())) + && (msgText == null || msgText.toString().equals(archetype.getMsgText())) && multiX == archetype.getMultiY() && multiY == archetype.getMultiX() && (editorFolder == null || editorFolder.equals(archetype.getEditorFolder())) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-04-17 06:04:10
|
Revision: 3894 http://gridarta.svn.sourceforge.net/gridarta/?rev=3894&view=rev Author: akirschbaum Date: 2008-04-16 23:04:03 -0700 (Wed, 16 Apr 2008) Log Message: ----------- Remove commented (and broken) code. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-04-16 21:22:16 UTC (rev 3893) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2008-04-17 06:04:03 UTC (rev 3894) @@ -755,14 +755,6 @@ * @deprecated use arch object matchers, this method will be removed */ @Deprecated private int calculateEditType(final int checkType) { - /* if one of the types in checkType already is in editType, - // we exclude that one - if ((checkType & editType) != 0) { - checkType -= (checkType & editType); - } - */ - - // bail out if nothing to do if (checkType == 0) { return editType; } @@ -801,6 +793,7 @@ return editType; } + /** * Returns the edit type. * @return edit type This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |