You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(103) |
Jun
(121) |
Jul
(16) |
Aug
(67) |
Sep
(126) |
Oct
(161) |
Nov
(164) |
Dec
(588) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(394) |
Feb
(181) |
Mar
(131) |
Apr
(180) |
May
(255) |
Jun
(11) |
Jul
(79) |
Aug
(70) |
Sep
(274) |
Oct
(138) |
Nov
(195) |
Dec
(8) |
2008 |
Jan
(3) |
Feb
(142) |
Mar
(162) |
Apr
(124) |
May
(148) |
Jun
(157) |
Jul
(425) |
Aug
(373) |
Sep
(264) |
Oct
(315) |
Nov
(225) |
Dec
(6) |
2009 |
Jan
(67) |
Feb
(78) |
Mar
(279) |
Apr
(294) |
May
(92) |
Jun
(65) |
Jul
(134) |
Aug
(41) |
Sep
(138) |
Oct
(125) |
Nov
(126) |
Dec
(122) |
2010 |
Jan
(15) |
Feb
(48) |
Mar
(9) |
Apr
(195) |
May
(373) |
Jun
(507) |
Jul
(42) |
Aug
(16) |
Sep
(38) |
Oct
(81) |
Nov
(64) |
Dec
(18) |
2011 |
Jan
(13) |
Feb
(12) |
Mar
(39) |
Apr
(1) |
May
(2) |
Jun
(27) |
Jul
(27) |
Aug
(31) |
Sep
(14) |
Oct
(102) |
Nov
(20) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(18) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(47) |
Jun
(7) |
Jul
(107) |
Aug
|
Sep
|
Oct
(112) |
Nov
(31) |
Dec
(17) |
2014 |
Jan
(29) |
Feb
(111) |
Mar
(34) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(18) |
Dec
(10) |
From: <chr...@us...> - 2006-10-09 12:16:00
|
Revision: 534 http://svn.sourceforge.net/gridarta/?rev=534&view=rev Author: christianhujer Date: 2006-10-09 05:15:54 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Fixed bogus variable naming. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-10-09 12:15:32 UTC (rev 533) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2006-10-09 12:15:54 UTC (rev 534) @@ -449,7 +449,7 @@ final String text = gameObject.getObjectText(); final int len = text.length(); - final GameObject defarch = gameObject.getArchetype(); + final GameObject archetype = gameObject.getArchetype(); gameObject.resetObjectText(); // so, lets check the stuff a last time @@ -471,27 +471,27 @@ } } if (gameObject.getDirection() == -1) { // still the invalid direction! - gameObject.setDirection(defarch.getDirection()); + gameObject.setDirection(archetype.getDirection()); } gameObject.setRealFace(gameObject.getFaceRealName()); // if the type is still unset, then we take the default one if (gameObject.getArchTypNr() == GameObject.TYPE_UNSET) { - gameObject.setArchTypNr(defarch.getArchTypNr()); + gameObject.setArchTypNr(archetype.getArchTypNr()); } // if the type is still unset, then we take the default one - if (defarch.getMultiShapeID() > 0 && gameObject.getMultiShapeID() == 0) { - gameObject.setMultiShapeID(defarch.getMultiShapeID()); + if (archetype.getMultiShapeID() > 0 && gameObject.getMultiShapeID() == 0) { + gameObject.setMultiShapeID(archetype.getMultiShapeID()); } - if (defarch.getMultiPartNr() > 0 && gameObject.getMultiPartNr() == 0) { - gameObject.setMultiPartNr(defarch.getMultiPartNr()); + if (archetype.getMultiPartNr() > 0 && gameObject.getMultiPartNr() == 0) { + gameObject.setMultiPartNr(archetype.getMultiPartNr()); } - if (defarch.isLowestPart()) { + if (archetype.isLowestPart()) { gameObject.setLowestPart(true); } - gameObject.setMultiX(defarch.getMultiX()); - gameObject.setMultiY(defarch.getMultiY()); + gameObject.setMultiX(archetype.getMultiX()); + gameObject.setMultiY(archetype.getMultiY()); // arch.setEditType(defarch.getEditType()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 12:15:37
|
Revision: 533 http://svn.sourceforge.net/gridarta/?rev=533&view=rev Author: christianhujer Date: 2006-10-09 05:15:32 -0700 (Mon, 09 Oct 2006) Log Message: ----------- added TODO for improvement. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-10-09 12:10:51 UTC (rev 532) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2006-10-09 12:15:32 UTC (rev 533) @@ -463,6 +463,7 @@ final String text = gameObject.getObjectText(); final int len = text.length(); + // TODO can't this be replaced by archetype = gameObject.getArchetype() ? final GameObject archetype = mainControl.getArchetype(gameObject.getArchetypeName()); gameObject.resetObjectText(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 12:11:01
|
Revision: 532 http://svn.sourceforge.net/gridarta/?rev=532&view=rev Author: christianhujer Date: 2006-10-09 05:10:51 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Changed CMapFileEncode to use Archetype instead of GameObject for archetypes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/daimonin/src/daieditor/CMapFileEncode.java Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-10-09 12:07:06 UTC (rev 531) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-10-09 12:10:51 UTC (rev 532) @@ -40,6 +40,7 @@ import java.util.HashMap; import java.util.Map; import net.sf.gridarta.Size2D; +import net.sf.gridarta.gameobject.Archetype; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -133,7 +134,7 @@ * @return true if arch was written successfully */ boolean writeMapArch(final GameObject gameObject, final boolean isInventory) { - final GameObject archetype = gameObject.getArchetype(); + final Archetype<GameObject> archetype = gameObject.getArchetype(); // Collect all fields to write. final Map<String, String> fields = new HashMap<String, String>(); // String key -> String value Modified: trunk/daimonin/src/daieditor/CMapFileEncode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-10-09 12:07:06 UTC (rev 531) +++ trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-10-09 12:10:51 UTC (rev 532) @@ -33,6 +33,7 @@ import java.io.IOException; import java.util.Formatter; import net.sf.gridarta.Size2D; +import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.map.MapSquare; import net.sf.gridarta.io.IOUtils; @@ -109,7 +110,7 @@ * @throws IOException in case of I/O problems */ private void writeGameObject(final GameObject gameObject, final int x, final int y) throws IOException { - final GameObject archetype = gameObject.getArchetype(); + final Archetype<GameObject> archetype = gameObject.getArchetype(); // ok, we start with the standard parts... this is valid for all types format.format("arch %s\n", gameObject.getArchetypeName()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 12:07:16
|
Revision: 531 http://svn.sourceforge.net/gridarta/?rev=531&view=rev Author: christianhujer Date: 2006-10-09 05:07:06 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Added isMulti() to Archetype. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 12:05:49 UTC (rev 530) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 12:07:06 UTC (rev 531) @@ -78,6 +78,10 @@ // TODO check whether this should return G or Archetype<G> @Nullable public abstract G getMultiNext(); + // TODO proper documentation + /** @return true if 'this' arch is part of a multisquare object */ + boolean isMulti(); + // TODO documentation int getArchTypNr(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 12:05:58
|
Revision: 530 http://svn.sourceforge.net/gridarta/?rev=530&view=rev Author: christianhujer Date: 2006-10-09 05:05:49 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Replaced Archetype field access by Archetype method access. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/GameObject.java Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 10:57:09 UTC (rev 529) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 12:05:49 UTC (rev 530) @@ -467,7 +467,7 @@ * @param name */ public boolean setRealFace(final String name) { - final String face = getArchetype().faceRealName; + final String face = getArchetype().getFaceRealName(); /* no name? we always use def arch face */ if (name == null || name.trim().length() == 0) { @@ -495,7 +495,7 @@ if (effectiveAnimName == null) { faceobjdesc = FaceDesc.DEFARCH_ANIM; if (hasArchetype()) { - effectiveAnimName = getArchetype().animName; + effectiveAnimName = getArchetype().getAnimName(); } } @@ -527,7 +527,7 @@ if (effectiveFaceObjName == null) { faceobjdesc = FaceDesc.DEFARCH_FACE; if (hasArchetype()) { - effectiveFaceObjName = getArchetype().faceRealName; + effectiveFaceObjName = getArchetype().getFaceRealName(); } } } 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:57:20
|
Revision: 529 http://svn.sourceforge.net/gridarta/?rev=529&view=rev Author: christianhujer Date: 2006-10-09 03:57:09 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Changed CAttribDialogs to use Archetype instead of GameObject for the Archetype. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/daimonin/src/daieditor/CAttribDialog.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-09 10:56:31 UTC (rev 528) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-10-09 10:57:09 UTC (rev 529) @@ -67,6 +67,7 @@ import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; import net.sf.gridarta.help.Help; +import net.sf.gridarta.gameobject.Archetype; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -122,7 +123,7 @@ private final GameObject gameObject; - private final GameObject archetype; + private final Archetype<GameObject> archetype; private CFArchType type; // reference to the type data @@ -1169,7 +1170,7 @@ if (dType == CFArchAttrib.T_BOOL) { // a boolean attribute (flag) if (((BoolAttrib) attr).input.isSelected() != - (archetype.getAttributeInt(attr.ref.getNameOld(), false) == 1)) { + (archetype.getAttributeInt(attr.ref.getNameOld()) == 1)) { newArchText = newArchText + attr.ref.getNameOld() + " " + (((BoolAttrib) attr).input.isSelected() ? 1 : 0) + "\n"; } @@ -1182,31 +1183,31 @@ valString = attr.ref.getMisc()[1]; // false string } // now see if we need to write it into the archtext or not - if ((valString.equals("0") && !(archetype.getAttributeString(attr.ref.getNameOld(), false).length() == 0)) || (!valString.equals("0") && !archetype.getAttributeString(attr.ref.getNameOld(), false).equals(valString))) { + if ((valString.equals("0") && !(archetype.getAttributeString(attr.ref.getNameOld()).length() == 0)) || (!valString.equals("0") && !archetype.getAttributeString(attr.ref.getNameOld()).equals(valString))) { newArchText = newArchText + attr.ref.getNameOld() + " " + valString + "\n"; } } else if (dType == CFArchAttrib.T_INT || dType == CFArchAttrib.T_FLOAT) { // an int attribute if (dType == CFArchAttrib.T_INT && ((IntAttrib) attr).input.getText().trim().length() == 0) { - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != 0) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0\n"; } } else if (dType == CFArchAttrib.T_FLOAT && ((FloatAttrib) attr).input.getText().trim().length() == 0) { - if (archetype.getAttributeString(attr.ref.getNameOld(), false).length() > 0) { + if (archetype.getAttributeString(attr.ref.getNameOld()).length() > 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0.0\n"; } } else { try { if (dType == CFArchAttrib.T_INT) { final int value = Integer.parseInt(((IntAttrib) attr).input.getText().trim()); - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != value) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + " " + value + "\n"; } } else { // try to parse floating point final double value = Double.parseDouble(((FloatAttrib) attr).input.getText().trim()); - final String defValueStr = archetype.getAttributeString(attr.ref.getNameOld(), false).trim(); + final String defValueStr = archetype.getAttributeString(attr.ref.getNameOld()).trim(); final double defValue; if (defValueStr.length() > 0) { defValue = Double.parseDouble(defValueStr); @@ -1252,7 +1253,7 @@ newFace = ""; } } else { - if (!inline.equals(archetype.getAttributeString(attr.ref.getNameOld(), false))) { + if (!inline.equals(archetype.getAttributeString(attr.ref.getNameOld()))) { newArchText = newArchText + attr.ref.getNameOld() + " " + inline + "\n"; } } @@ -1278,19 +1279,19 @@ if (attrVal == -1 || (attrVal == 0 && dType != CFArchAttrib.T_SPELL && dType != CFArchAttrib.T_ZSPELL)) { - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != 0) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0\n"; } } else if (attrVal == 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0\n"; - } else if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != attrVal) { + } else if (archetype.getAttributeInt(attr.ref.getNameOld()) != attrVal) { newArchText = newArchText + attr.ref.getNameOld() + " " + attrVal + "\n"; } } else if (dType == CFArchAttrib.T_BITMASK) { // a bitmask attribute (similar to integer, but easier because no parsing needed) final int value = ((BitmaskAttrib) attr).getValue(); // get bitmask value - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != value) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + " " + value + "\n"; } } else if (dType == CFArchAttrib.T_TREASURE) { @@ -1301,7 +1302,7 @@ final boolean isNone = inline.equals(CFTreasureListTree.NONE_SYM) || inline.length() == 0; if (!isNone && !CFTreasureListTree.getInstance().containsTreasureList(inline) && - !inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld(), false))) { + !inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld()))) { // The user has specified a WRONG treasurelist name, and it does not come // from the default gameObject. -> Error and out. JOptionPane.showMessageDialog(this, "In attribute '" + attr.ref.getNameNew() + "':\n" + @@ -1310,8 +1311,8 @@ throw new GridderException(""); // bail out } - if (!inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld(), false)) - && !(isNone && archetype.getAttributeString(attr.ref.getNameOld(), false).length() == 0)) { + if (!inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld())) + && !(isNone && archetype.getAttributeString(attr.ref.getNameOld()).length() == 0)) { if (isNone) { newArchText = newArchText + attr.ref.getNameOld() + " none\n"; } else { @@ -1325,7 +1326,7 @@ // Also write all the 'fixed' attributes into the archtext for (int i = 0; type.getAttr().length > i; i++) { if (type.getAttr()[i].getDataType() == CFArchAttrib.T_FIXED) { - final String defaultValue = archetype.getAttributeString(type.getAttr()[i].getNameOld(), false); + final String defaultValue = archetype.getAttributeString(type.getAttr()[i].getNameOld()); if (defaultValue.length() == 0 || (gameObject.getArchTypNr() != archetype.getArchTypNr() && !defaultValue.equalsIgnoreCase(type.getAttr()[i].getNameNew()))) { // usually, fixed attributes are only applied when *not* defined in the archetype. Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-09 10:56:31 UTC (rev 528) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-10-09 10:57:09 UTC (rev 529) @@ -106,6 +106,7 @@ import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; import net.sf.gridarta.help.Help; +import net.sf.gridarta.gameobject.Archetype; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import static net.sf.japi.util.Arrays2.linearSearch; @@ -144,7 +145,7 @@ private final GameObject gameObject; - private final GameObject archetype; + private final Archetype<GameObject> archetype; private CFArchType type; // reference to the type data @@ -1044,7 +1045,7 @@ // TODO: switch case if (dType == BOOL) { // a boolean attribute (flag) - if (((DialogAttrib<JCheckBox>) attr).input.isSelected() != (archetype.getAttributeInt(attr.ref.getNameOld(), false) == 1)) { + if (((DialogAttrib<JCheckBox>) attr).input.isSelected() != (archetype.getAttributeInt(attr.ref.getNameOld()) == 1)) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + (((DialogAttrib<JCheckBox>) attr).input.isSelected() ? 1 : 0) + '\n'; } } else if (dType == BOOL_SPEC) { @@ -1056,31 +1057,31 @@ valString = attr.ref.getMisc()[1]; // false string } // now see if we need to write it into the archtext or not - if ("0".equals(valString) && !(archetype.getAttributeString(attr.ref.getNameOld(), false).length() == 0) || !valString.equals("0") && !archetype.getAttributeString(attr.ref.getNameOld(), false).equals(valString)) + if ("0".equals(valString) && !(archetype.getAttributeString(attr.ref.getNameOld()).length() == 0) || !valString.equals("0") && !archetype.getAttributeString(attr.ref.getNameOld()).equals(valString)) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + valString + '\n'; } } else if (dType == INT || dType == LONG || dType == FLOAT) { // an int attribute if ("0".equals(((DialogAttrib<JFormattedTextField>) attr).input.getText())) { - if (archetype.getAttributeDouble(attr.ref.getNameOld(), false) != 0) { + if (archetype.getAttributeDouble(attr.ref.getNameOld()) != 0) { newArchText = newArchText + attr.ref.getNameOld() + " " + (dType == FLOAT ? "0.0" : "0") + "\n"; } } else { try { if (dType == INT) { final int value = ((Number) ((DialogAttrib<JFormattedTextField>) attr).input.getValue()).intValue(); - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != value) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + value + '\n'; } } else if (dType == LONG) { final long value = ((Number) ((DialogAttrib<JFormattedTextField>) attr).input.getValue()).longValue(); - if (archetype.getAttributeLong(attr.ref.getNameOld(), false) != value) { + if (archetype.getAttributeLong(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + value + '\n'; } } else { final double value = ((Number) ((DialogAttrib<JFormattedTextField>) attr).input.getValue()).doubleValue(); - if (archetype.getAttributeDouble(attr.ref.getNameOld(), false) != value) { + if (archetype.getAttributeDouble(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + value + '\n'; } } @@ -1109,7 +1110,7 @@ newName = ""; } } else if ("animation".equalsIgnoreCase(attr.ref.getNameOld())) { - if (inline.length() > 0 && !inline.equals(archetype.getAttributeString(attr.ref.getNameOld(), false))) { + if (inline.length() > 0 && !inline.equals(archetype.getAttributeString(attr.ref.getNameOld()))) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + inline + '\n'; gameObject.setAnimName(inline); } else { @@ -1125,7 +1126,7 @@ } newFace = inline; } else { - if (!inline.equals(archetype.getAttributeString(attr.ref.getNameOld(), false))) { + if (!inline.equals(archetype.getAttributeString(attr.ref.getNameOld()))) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + inline + '\n'; } } @@ -1148,12 +1149,12 @@ } if (attrVal == -1 || attrVal == 0 && dType != SPELL && dType != ZSPELL) { - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != 0) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0\n"; } } else if (attrVal == 0) { newArchText = newArchText + attr.ref.getNameOld() + " 0\n"; - } else if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != attrVal) { + } else if (archetype.getAttributeInt(attr.ref.getNameOld()) != attrVal) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + attrVal + '\n'; } } else if (dType == DBLLIST) { @@ -1162,14 +1163,14 @@ final int val2 = (Integer) typelist.getListTable().get(attr.ref.getMisc()[1]).get(2 * ((JComboBox[]) attr.input)[1].getSelectedIndex()); final int combinedVal = val1 + val2; - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != combinedVal) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != combinedVal) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + combinedVal + '\n'; } } else if (dType == BITMASK) { // a bitmask attribute (similar to integer, but easier because no parsing needed) final int value = ((BitmaskAttrib) attr).getValue(); // get bitmask value - if (archetype.getAttributeInt(attr.ref.getNameOld(), false) != value) { + if (archetype.getAttributeInt(attr.ref.getNameOld()) != value) { newArchText = newArchText + attr.ref.getNameOld() + ' ' + value + '\n'; } } else if (dType == TREASURE) { @@ -1180,15 +1181,15 @@ final boolean isNone = inline.equals(CFTreasureListTree.NONE_SYM) || inline.length() == 0; if (!isNone && !CFTreasureListTree.containsTreasureList(inline) - && !inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld(), false))) { + && !inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld()))) { // The user has specified a WRONG treasurelist name, and it does not come // from the default gameObject. -> Error and out. showMessageDialog(this, "In attribute '" + attr.ref.getNameNew() + "':\n" + '\'' + inline + "' is not a known treasurelist name!", "Input Error", ERROR_MESSAGE); return false; } - if (!inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld(), false)) - && !(isNone && archetype.getAttributeString(attr.ref.getNameOld(), false).length() == 0)) { + if (!inline.equalsIgnoreCase(archetype.getAttributeString(attr.ref.getNameOld())) + && !(isNone && archetype.getAttributeString(attr.ref.getNameOld()).length() == 0)) { if (isNone) { newArchText = newArchText + attr.ref.getNameOld() + " none\n"; } else { @@ -1203,7 +1204,7 @@ for (int i = 0; type.getAttr().length > i; i++) { // ### TODO: for changed types, copy fixed attributes over default arches ### if (type.getAttr()[i].getDataType() == FIXED) { - final String defaultValue = archetype.getAttributeString(type.getAttr()[i].getNameOld(), false); + final String defaultValue = archetype.getAttributeString(type.getAttr()[i].getNameOld()); if (defaultValue.length() == 0 || gameObject.getArchTypNr() != archetype.getArchTypNr() && !defaultValue.equalsIgnoreCase(type.getAttr()[i].getNameNew())) { // usually, fixed attributes are only applied when *not* defined in the archetype. 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:56:42
|
Revision: 528 http://svn.sourceforge.net/gridarta/?rev=528&view=rev Author: christianhujer Date: 2006-10-09 03:56:31 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Added faceRealName, animName and direction for temporary compatibility. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/Archetype.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 10:46:57 UTC (rev 527) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 10:56:31 UTC (rev 528) @@ -466,6 +466,21 @@ return faceName; } + /** {@inheritDoc} */ + public String getFaceRealName() { + return null; + } + + /** {@inheritDoc} */ + public String getAnimName() { + return null; + } + + /** {@inheritDoc} */ + public int getDirection() { + return 0; + } + /** * {@inheritDoc} * @todo this method is too slow - find a faster way Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 10:46:57 UTC (rev 527) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 10:56:31 UTC (rev 528) @@ -31,6 +31,8 @@ * @param attributeName Name of the attribute value to return. * @return Attribute value or <code>""</code> (empty String) if not found. * @see #getAttributeInt(String) + * @see #getAttributeLong(String) + * @see #getAttributeDouble(String) */ String getAttributeString(@NotNull String attributeName); @@ -43,6 +45,22 @@ int getAttributeInt(@NotNull String attributeName); /** + * Returns an attribute value of this Archetype as long. + * @param attributeName Name of the attribute value to return. + * @return Attribute value or <code>0</code> (zero) if not found. + * @see #getAttributeString(String) + */ + long getAttributeLong(@NotNull String attributeName); + + /** + * Returns an attribute value of this Archetype as double. + * @param attributeName Name of the attribute value to return. + * @return Attribute value or <code>0.0</code> (zero) if not found. + * @see #getAttributeString(String) + */ + double getAttributeDouble(@NotNull String attributeName); + + /** * Returns the name of the object as shown to the player. * @return The name of the object as shown to the player. */ @@ -68,7 +86,32 @@ * @return The name of the face of this Archetype. * @deprecated compatibility method * @todo document nullability + * @todo check whether this isn't the same as {@link #getFaceRealName()}. */ @Deprecated String getFaceName(); + /** + * DaiEditor only: Returns the real name of the face. + * @return The real name of the face of this Archetype. + * @deprecated compatibility method + * @todo document nullability + * @todo check whether this isn't the same as {@link #getFaceName()}. + */ + @Deprecated String getFaceRealName(); + + /** + * DaiEditor only: Returns the name of the animation. + * @return The name of the animation. + * @deprecated compatibility method + * @todo document nullability + */ + @Deprecated String getAnimName(); + + /** + * DaiEditor only: Returns the direction. + * @return The direction. + * @deprecated compatibility method + */ + @Deprecated int getDirection(); + } // interface Archetype 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:47:08
|
Revision: 527 http://svn.sourceforge.net/gridarta/?rev=527&view=rev Author: christianhujer Date: 2006-10-09 03:46:57 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Added FaceName for temporary compatibility. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/Archetype.java Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 10:41:55 UTC (rev 526) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 10:46:57 UTC (rev 527) @@ -367,6 +367,11 @@ return archType; } + /** {@inheritDoc} */ + public String getFaceName() { + return null; + } + public void setArchTypNr(final int type) { archType = type; } Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 10:41:55 UTC (rev 526) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 10:46:57 UTC (rev 527) @@ -63,4 +63,12 @@ // TODO documentation int getArchTypNr(); + /** + * CFEditor only: Returns the name of the face. + * @return The name of the face of this Archetype. + * @deprecated compatibility method + * @todo document nullability + */ + @Deprecated String getFaceName(); + } // interface Archetype 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:42:01
|
Revision: 526 http://svn.sourceforge.net/gridarta/?rev=526&view=rev Author: christianhujer Date: 2006-10-09 03:41:55 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Rationalized access on arch panel selection. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-10-09 10:38:04 UTC (rev 525) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-10-09 10:41:55 UTC (rev 526) @@ -1286,14 +1286,14 @@ needRedraw = insertSelArchToMap(mapLoc, true); // get name of inserted arch (this is display in status bar while dragging) - GameObject insArch; - if ((insArch = mainControl.getArchPanelSelection()) != null) { + @Nullable final GameObject insArch = mainControl.getArchPanelSelection(); + if (insArch != null) { if (insArch.getObjName() != null && insArch.getObjName().length() > 0) { - insertArchName = mainControl.getArchPanelSelection().getObjName(); + insertArchName = insArch.getObjName(); } else if (insArch.getArchetypeName() != null && insArch.getArchetypeName().length() > 0) { - insertArchName = mainControl.getArchPanelSelection().getArchetypeName(); - } else if ((insArch = insArch.getArchetype()) != null) { - insertArchName = mainControl.getArchPanelSelection().getArchetypeName(); + insertArchName = insArch.getArchetypeName(); + } else if (insArch.getArchetype() != null) { + insertArchName = insArch.getArchetype().getArchetypeName(); } else { insertArchName = "unknown"; } 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:38:08
|
Revision: 525 http://svn.sourceforge.net/gridarta/?rev=525&view=rev Author: christianhujer Date: 2006-10-09 03:38:04 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Fixed whitespace formatting. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-10-09 10:36:59 UTC (rev 524) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-10-09 10:38:04 UTC (rev 525) @@ -1084,7 +1084,7 @@ // right mouse button: insert arch if ((e.getModifiers() & MouseEvent.BUTTON3_MASK) != 0) { - insertObject(mapLoc); + insertObject(mapLoc); } else if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0) { if (e.isShiftDown()) { insertObject(mapLoc); 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:37:06
|
Revision: 524 http://svn.sourceforge.net/gridarta/?rev=524&view=rev Author: christianhujer Date: 2006-10-09 03:36:59 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Removed unused variable. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFArchTypeList.java Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-10-09 10:27:32 UTC (rev 523) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-10-09 10:36:59 UTC (rev 524) @@ -540,7 +540,6 @@ CFArchType tmp = head.getNext(); // tmp cycles through all types CFArchType type = tmp; // return value: the type of the arch, first one (misc) if no other found - final GameObject defarch = arch.getArchetype(); boolean typeFound = false; for (int i = 0; tmp != null && !typeFound; tmp = tmp.getNext(), i++) { 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-10-09 10:24:34
|
Revision: 522 http://svn.sourceforge.net/gridarta/?rev=522&view=rev Author: christianhujer Date: 2006-10-09 03:24:17 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Pulled editType up to gridarta GameObject and documented its deprecation. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 10:17:56 UTC (rev 521) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 10:24:17 UTC (rev 522) @@ -92,9 +92,6 @@ private int archType; // CF object type of the arch - /** Edit Type. */ - private int editType; // for view settings - private AutojoinList join; // if nonzero, pointing to the list of autojoining archetypes /** Create an GameObject. */ @@ -116,7 +113,6 @@ editflag = false; join = null; // no autojoin list per default archType = TYPE_UNSET; // type must be set - editType = 0; } public static void setTypeList(final CFArchTypeList tlist) { @@ -124,16 +120,6 @@ } /** {@inheritDoc} */ - public int getEditType() { - return editType; - } - - /** {@inheritDoc} */ - public void setEditType(final int editType) { - this.editType = editType; - } - - /** {@inheritDoc} */ public int calculateEditType(final int checkType) { // ATTENTION! BE VERY CAREFUL WHEN YOU TRY TO UNIFY MORE OF THIS WITH DAIMONIN! /* if one of the types in checkType already is in editType, Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 10:17:56 UTC (rev 521) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 10:24:17 UTC (rev 522) @@ -107,9 +107,6 @@ private int archType; // CF object type of the arch - /** Edit Type. */ - private int editType; // for view settings - /** Editor Folder. */ private String editorFolder; @@ -130,16 +127,6 @@ typeList = tlist; } - /** {@inheritDoc} */ - public int getEditType() { - return editType; - } - - /** {@inheritDoc} */ - public void setEditType(final int editType) { - this.editType = editType; - } - /** * {@inheritDoc} * @deprecated use arch object matchers, this method will be removed Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 10:17:56 UTC (rev 521) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 10:24:17 UTC (rev 522) @@ -84,6 +84,14 @@ protected int multiY = 0; /** + * Edit Type. + * @deprecated bad design for multiple reasons: + * * Data is knowing view information (that's not nice) + * * Not extensible + */ + @Deprecated protected int editType; + + /** * Constructor. */ protected GameObject() { @@ -546,7 +554,9 @@ * @see #calculateEditType(int) * @see #setEditType(int) */ - public abstract int getEditType(); + public int getEditType() { + return editType; + } /** * Sets the edit type of this GameObject. @@ -554,7 +564,9 @@ * @see #calculateEditType(int) * @see #getEditType() */ - public abstract void setEditType(int editType); + public void setEditType(final int editType) { + this.editType = editType; + } /** Delete message text by nullification. */ public void deleteMsgText() { 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:18:00
|
Revision: 521 http://svn.sourceforge.net/gridarta/?rev=521&view=rev Author: christianhujer Date: 2006-10-09 03:17:56 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Removed objName from cfeditor GameObject constructor - now only createClone() is left. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 10:15:57 UTC (rev 520) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 10:17:56 UTC (rev 521) @@ -107,8 +107,6 @@ animText = loreText = null; archTextCount = 0; // lines inserted in objectText - objName = null; - noface = true; // this sucker has no face faceName = null; // if there is a face cmd, this is the face name facenr = -1; // if we have a face AND we have loaded the face, this is his number. 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:16:07
|
Revision: 520 http://svn.sourceforge.net/gridarta/?rev=520&view=rev Author: christianhujer Date: 2006-10-09 03:15:57 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Added getArchTypNr() and getMultiNext() to Archetype. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 09:59:59 UTC (rev 519) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 10:15:57 UTC (rev 520) @@ -56,4 +56,11 @@ */ @Nullable String getMsgText(); + // TODO add documentation + // TODO check whether this should return G or Archetype<G> + @Nullable public abstract G getMultiNext(); + + // TODO documentation + int getArchTypNr(); + } // interface Archetype Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 09:59:59 UTC (rev 519) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 10:15:57 UTC (rev 520) @@ -424,6 +424,9 @@ head.container.remove(head); } + // TODO documentation + public abstract int getArchTypNr(); + /** * Get the Archetype this GameObject is based on. * @return Archetype this GameObject is based on. @@ -650,6 +653,7 @@ */ public abstract G getHead(); + // TODO add documentation @Nullable public abstract G getMultiNext(); /** 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:00:05
|
Revision: 519 http://svn.sourceforge.net/gridarta/?rev=519&view=rev Author: christianhujer Date: 2006-10-09 02:59:59 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Added objName and msgText to Archetype interface. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 08:46:03 UTC (rev 518) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 09:59:59 UTC (rev 519) @@ -1,6 +1,7 @@ package net.sf.gridarta.gameobject; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Reflects an Archetype. @@ -41,4 +42,18 @@ */ int getAttributeInt(@NotNull String attributeName); + /** + * Returns the name of the object as shown to the player. + * @return The name of the object as shown to the player. + */ + @Nullable String getObjName(); + + /** + * Returns the message bound to this object. + * If the message is empty, the empty String is returned. + * If the object has no message, this method returns <code>null</code>. + * @return message bound to this object + */ + @Nullable String getMsgText(); + } // interface Archetype 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:46:20
|
Revision: 518 http://svn.sourceforge.net/gridarta/?rev=518&view=rev Author: christianhujer Date: 2006-10-09 01:46:03 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Pulled getBestName() up. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 08:43:02 UTC (rev 517) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 08:46:03 UTC (rev 518) @@ -473,26 +473,6 @@ noface = flag; } - /** - * Name which is best appropriate to describe this arch. (This can be - * arch/object name or default arch/object name) - * @return best suitable descriptive name - */ - public String getBestName() { - final GameObject 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 (archetypeName != null && archetypeName.length() > 0) { - return archetypeName; - } else if (archetype != null && archetype.archetypeName != null) { - return archetype.archetypeName; - } - - return "???"; // this case should actually never happen - } - // face name public void setFaceName(final String name) { faceName = name != null ? name.intern() : null; Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 08:43:02 UTC (rev 517) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 08:46:03 UTC (rev 518) @@ -418,26 +418,6 @@ return faceobjdesc; } - /** - * Name which is best appropriate to describe this arch. (This can be - * arch/object name or default arch/object name) - * @return best suitable descriptive name - */ - public String getBestName() { - final GameObject 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 (archetypeName != null && archetypeName.length() > 0) { - return archetypeName; - } else if (archetype != null && archetype.archetypeName != null) { - return archetype.archetypeName; - } - - return "???"; // this case should actually never happen - } - // face name private void setFaceObjName(final String faceObjName) { if (faceObjName != null) { Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:43:02 UTC (rev 517) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:46:03 UTC (rev 518) @@ -687,6 +687,25 @@ } /** + * Name which is best appropriate to describe this arch. (This can be + * arch/object name or default arch/object name) + * @return best suitable descriptive name + */ + public String getBestName() { + final GameObject 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 (archetypeName != null && archetypeName.length() > 0) { + return archetypeName; + } else if (archetype != null && archetype.archetypeName != null) { + return archetype.archetypeName; + } + return "???"; // this case should actually never happen + } + + /** * Returns the object text of this GameObject as String. * @return the object 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:43:16
|
Revision: 517 http://svn.sourceforge.net/gridarta/?rev=517&view=rev Author: christianhujer Date: 2006-10-09 01:43:02 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Merged archetypeName. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 08:36:43 UTC (rev 516) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 08:43:02 UTC (rev 517) @@ -60,9 +60,6 @@ private String faceName; // face name : 1 - /** Archetype name. */ - private String archetypeName = null; - private StringBuffer animText; // anim text buffer private StringBuffer loreText; // lore text buffer @@ -477,19 +474,6 @@ } /** - * Set the archetype name. - * @param archetypeName the archetype name - */ - public void setArchetypeName(final String archetypeName) { - this.archetypeName = archetypeName != null ? archetypeName.intern() : null; - } - - /** {@inheritDoc} */ - public String getArchetypeName() { - return archetypeName; - } - - /** * Name which is best appropriate to describe this arch. (This can be * arch/object name or default arch/object name) * @return best suitable descriptive name Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 08:36:43 UTC (rev 516) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 08:43:02 UTC (rev 517) @@ -68,9 +68,6 @@ /** Object face name <code>face <var>name</var></code>. */ private String faceRealName; - /** Archetype name. */ - private String archetypeName = null; - /** Object animation <code>animation <var>animName</var></code>. */ private String animName; @@ -422,19 +419,6 @@ } /** - * Set the archetype name. - * @param archetypeName the archetype name - */ - public void setArchetypeName(final String archetypeName) { - this.archetypeName = archetypeName != null ? archetypeName.intern() : null; - } - - /** {@inheritDoc} */ - public String getArchetypeName() { - return archetypeName; - } - - /** * Name which is best appropriate to describe this arch. (This can be * arch/object name or default arch/object name) * @return best suitable descriptive name Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:36:43 UTC (rev 516) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:43:02 UTC (rev 517) @@ -37,6 +37,9 @@ /** The Archetype of this GameObject. */ @NotNull private G archetype; + /** The name of the Archetype associated with this GameObject or the Archetypes name itself if this GameObject is an Archetype. */ + @Nullable protected String archetypeName; + /** The name of this object. */ @Nullable protected String objName; @@ -487,9 +490,19 @@ * For an Archetype this method simply returns its name. * @return the name of the Archetype this GameObject is based on */ - @NotNull public abstract String getArchetypeName(); + @Nullable public String getArchetypeName() { + return archetypeName; + } /** + * Set the archetype name. + * @param archetypeName the archetype name + */ + public void setArchetypeName(final String archetypeName) { + this.archetypeName = archetypeName != null ? archetypeName.intern() : null; + } + + /** * 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>. 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 08:34:24
|
Revision: 515 http://svn.sourceforge.net/gridarta/?rev=515&view=rev Author: christianhujer Date: 2006-10-09 01:34:08 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Merged objName. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 08:27:10 UTC (rev 514) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-10-09 08:34:08 UTC (rev 515) @@ -63,9 +63,6 @@ /** Archetype name. */ private String archetypeName = null; - /** The name of this object. */ - private String objName; - private StringBuffer animText; // anim text buffer private StringBuffer loreText; // lore text buffer @@ -512,22 +509,6 @@ return "???"; // this case should actually never happen } - /** - * Sets the name of this object. - * @param objName the name of this object. - */ - public void setObjName(final String objName) { - this.objName = objName != null ? objName.intern() : null; - } - - /** - * Returns the name of this object. - * @return the name of this object. - */ - public String getObjName() { - return objName; - } - // face name public void setFaceName(final String name) { faceName = name != null ? name.intern() : null; Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 08:27:10 UTC (rev 514) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-10-09 08:34:08 UTC (rev 515) @@ -71,9 +71,6 @@ /** Archetype name. */ private String archetypeName = null; - /** The name of this object. */ - private String objName; - /** Object animation <code>animation <var>animName</var></code>. */ private String animName; @@ -457,22 +454,6 @@ return "???"; // this case should actually never happen } - /** - * Sets the name of this object. - * @param objName the name of this object. - */ - public void setObjName(final String objName) { - this.objName = objName != null ? objName.intern() : null; - } - - /** - * Returns the name of this object. - * @return the name of this object. - */ - public String getObjName() { - return objName; - } - // face name private void setFaceObjName(final String faceObjName) { if (faceObjName != null) { Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:27:10 UTC (rev 514) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2006-10-09 08:34:08 UTC (rev 515) @@ -37,6 +37,9 @@ /** The Archetype of this GameObject. */ @NotNull private G archetype; + /** The name of this object. */ + @Nullable protected String objName; + /** * The objectText with the differences from the Archetype. * @note Every line in the objectText must end on '\n', including the last line. @@ -661,6 +664,22 @@ } /** + * Returns the name of this object. + * @return the name of this object. + */ + @Nullable public String getObjName() { + return objName; + } + + /** + * Sets the name of this object. + * @param objName the name of this object. + */ + public void setObjName(@Nullable final String objName) { + this.objName = objName != null ? objName.intern() : null; + } + + /** * Returns the object text of this GameObject as String. * @return the object 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:27:15
|
Revision: 514 http://svn.sourceforge.net/gridarta/?rev=514&view=rev Author: christianhujer Date: 2006-10-09 01:27:10 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Added some archetype methods to Archetype interface. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java Modified: trunk/src/app/net/sf/gridarta/gameobject/Archetype.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 08:25:16 UTC (rev 513) +++ trunk/src/app/net/sf/gridarta/gameobject/Archetype.java 2006-10-09 08:27:10 UTC (rev 514) @@ -14,10 +14,31 @@ public interface Archetype<G extends GameObject<G>> { /** + * Create a new GameObject from this Archetype. + * @return New GameObject based on this Archetype. + */ + abstract G createArch(); + + /** + * Get the name of this Archetype. + * @return The name of this Archetype. + */ + @NotNull String getArchetypeName(); + + /** * Returns an attribute value of this Archetype. - * @param attributeName Name of the attribute value to return + * @param attributeName Name of the attribute value to return. * @return Attribute value or <code>""</code> (empty String) if not found. + * @see #getAttributeInt(String) */ String getAttributeString(@NotNull String attributeName); + /** + * Returns an attriute value of this Archetype as int. + * @param attributeName Name of the attribute value to return. + * @return Attribute value or <code>0</code> (zero) if not found. + * @see #getAttributeString(String) + */ + int getAttributeInt(@NotNull String attributeName); + } // interface Archetype 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:17:13
|
Revision: 512 http://svn.sourceforge.net/gridarta/?rev=512&view=rev Author: christianhujer Date: 2006-10-09 01:17:02 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Fixed bogus naming. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapFileDecode.java trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/daimonin/src/daieditor/CMapFileDecode.java Modified: trunk/crossfire/src/cfeditor/CMapFileDecode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-10-09 07:57:45 UTC (rev 511) +++ trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-10-09 08:17:02 UTC (rev 512) @@ -118,7 +118,7 @@ */ @Nullable private GameObject readArch(final BufferedReader myInput, String thisLine, final GameObject container) throws IOException { - GameObject arch; + GameObject gameObject; String thisLine2; boolean archflag, archmore, msgflag, animflag, scriptflag; final int y; @@ -129,7 +129,7 @@ msgflag = false; animflag = false; - arch = null; + gameObject = null; try { thisLine2 = thisLine; @@ -158,14 +158,14 @@ archflag = true; // from now on we are inside an arch if (!archmore) { - arch = new GameObject(); // create a new instance + gameObject = new GameObject(); // create a new instance // our arch! it has a name! - arch.setArchetypeName(thisLine.substring(x, thisLine.length())); + gameObject.setArchetypeName(thisLine.substring(x, thisLine.length())); // ok, we have setup our arch, now check for inventory if (container != null) { - container.addLast(arch); + container.addLast(gameObject); } } } @@ -175,46 +175,46 @@ if (thisLine.regionMatches(0, "endmsg", 0, 6)) { msgflag = false; } else { - arch.addMsgText(thisLine2 + "\n"); + gameObject.addMsgText(thisLine2 + "\n"); } } else if (animflag) { //arch.addArchText(thisLine + "\n"); if (thisLine.regionMatches(0, "mina", 0, 4)) { animflag = false; } else { // we not include anim yet in panel - arch.addAnimText(thisLine + "\n"); + gameObject.addAnimText(thisLine + "\n"); } // ok, we had a full arch... don't care here about map or object // now we test for a new arch - thats stuf in inventory // or the end... thats the end of this shit } else if (thisLine.startsWith("arch ")) { if (log.isDebugEnabled()) { - log.debug("GO INVENTORY: " + arch + " - " + thisLine); + log.debug("GO INVENTORY: " + gameObject + " - " + thisLine); } - readArch(myInput, thisLine, arch); + readArch(myInput, thisLine, gameObject); if (log.isDebugEnabled()) { - log.debug("GO INVENTORY2: " + arch + " - " + thisLine); + log.debug("GO INVENTORY2: " + gameObject + " - " + thisLine); } } else if (thisLine.startsWith("end")) { - objects.add(arch); + objects.add(gameObject); archflag = false; archmore = false; if (log.isDebugEnabled()) { - log.debug("LEAVE!: " + arch + " - " + thisLine); + log.debug("LEAVE!: " + gameObject + " - " + thisLine); } - return arch; + return gameObject; } else if (thisLine.regionMatches(0, "msg", 0, 3)) { // arch.addArchText(thisLine + "\n"); - arch.addMsgText(""); // this init the msg text buffer + gameObject.addMsgText(""); // this init the msg text buffer // in the case of msg/endmsg // with no content to overrule def msg msgflag = true; // this is a MUST, because we overrule "anim" test } else if (thisLine.regionMatches(0, "animation", 0, 9)) { - arch.addObjectText(thisLine + "\n"); + gameObject.addObjectText(thisLine + "\n"); } else if (thisLine.regionMatches(0, "anim_speed", 0, 10)) { - arch.addObjectText(thisLine + "\n"); + gameObject.addObjectText(thisLine + "\n"); } else if (thisLine.regionMatches(0, "anim", 0, 4)) { //arch.addArchText(thisLine + "\n"); animflag = true; @@ -228,37 +228,37 @@ // expecting: "event_type_plugin Name" final String type = thisLine.substring(6, i); final String plname = thisLine.substring(space + 1).trim(); - arch.addEventPlugin(type, plname); + gameObject.addEventPlugin(type, plname); } else if (k > 0) { // expecting: "event_type_options Name" final String type = thisLine.substring(6, k); final String eventopt = thisLine.substring(space + 1).trim(); - arch.addEventOptions(type, eventopt); + gameObject.addEventOptions(type, eventopt); } else { // expecting: "event_type filepath" final String type = thisLine.substring(6, space); final String path = thisLine.substring(space + 1).trim(); - arch.addEventScript(type, path); + gameObject.addEventScript(type, path); } } else { - log.warn("Arch " + arch.getArchetypeName() + " has incorrect event code '" + thisLine + "'"); - arch.addObjectText(thisLine + "\n"); // keep line, it might have a meaning after all + log.warn("Arch " + gameObject.getArchetypeName() + " has incorrect event code '" + thisLine + "'"); + gameObject.addObjectText(thisLine + "\n"); // keep line, it might have a meaning after all } } else if (thisLine.regionMatches(0, "x ", 0, 2)) { final int temp = Integer.parseInt(thisLine.substring(2)); if (temp > maxxlen) { maxxlen = temp; } - arch.setMapX(temp); + gameObject.setMapX(temp); } else if (thisLine.regionMatches(0, "y ", 0, 2)) { final int temp = Integer.parseInt(thisLine.substring(2)); if (temp > maxylen) { maxylen = temp; } - arch.setMapY(temp); + gameObject.setMapY(temp); // MT: there should be here no type or? - AV: WRONG, there defenitly should be! } else if (thisLine.startsWith("type ")) { - arch.setArchTypNr(Integer.parseInt(thisLine.substring(5))); + gameObject.setArchTypNr(Integer.parseInt(thisLine.substring(5))); // don't load it into the archtext! } else if (thisLine.regionMatches(0, "face ", 0, 5)) { int x; @@ -267,10 +267,10 @@ break; } } - arch.setFaceFlag(false); - arch.setFaceName(thisLine.substring(x, thisLine.length())); + gameObject.setFaceFlag(false); + gameObject.setFaceName(thisLine.substring(x, thisLine.length())); } else { - arch.addObjectText(thisLine + "\n"); + gameObject.addObjectText(thisLine + "\n"); } } else { // We are in a multipart tail arch ("more"), so we skip it: Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-10-09 07:57:45 UTC (rev 511) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-10-09 08:17:02 UTC (rev 512) @@ -38,7 +38,6 @@ import java.util.Arrays; import java.util.Comparator; import java.util.HashMap; -import java.util.Iterator; import java.util.Map; import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; @@ -85,10 +84,10 @@ final Point pos = new Point(); for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { - for (final GameObject node : mapModel.getMapSquare(pos)) { + for (final GameObject gameObject : mapModel.getMapSquare(pos)) { // only non multi suckers - if (!node.isMulti()) { - if (!writeMapArch(node, false)) { + if (!gameObject.isMulti()) { + if (!writeMapArch(gameObject, false)) { return; } } @@ -99,12 +98,12 @@ // second, we drop the multi part suckers out for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { - for (final GameObject node : mapModel.getMapSquare(pos)) { + for (final GameObject gameObject : mapModel.getMapSquare(pos)) { // search only for heads! - if (node.isMulti() && node.isHead()) { + if (gameObject.isMulti() && gameObject.isHead()) { // only the heads get stored in the mapfile // (that's much more efficient) - if (!writeMapArch(node, false)) { + if (!writeMapArch(gameObject, false)) { return; } } @@ -119,38 +118,38 @@ /** * Walk through the inventory of an arch and write everything into the file. - * @param start the container arch whose inventory is to be written + * @param container the container arch whose inventory is to be written */ - private void browseInvObjects(final GameObject start) { - for (final GameObject arch : start) { - writeMapArch(arch, true); + private void browseInvObjects(final GameObject container) { + for (final GameObject gameObject : container) { + writeMapArch(gameObject, true); } } /** * Here the map arch gets written into the file. - * @param arch <code>GameObject</code> to be written into the map + * @param gameObject <code>GameObject</code> to be written into the map * @param isInventory is 'arch' inside a container? true/false * @return true if arch was written successfully */ - boolean writeMapArch(final GameObject arch, final boolean isInventory) { - final GameObject defarch = arch.getArchetype(); + boolean writeMapArch(final GameObject gameObject, final boolean isInventory) { + final GameObject archetype = gameObject.getArchetype(); // Collect all fields to write. final Map<String, String> fields = new HashMap<String, String>(); // String key -> String value - final String name = arch.getObjName(); + final String name = gameObject.getObjName(); if (name != null) { fields.put("name", name); } - final String face = arch.getFaceName(); + final String face = gameObject.getFaceName(); if (face != null) { fields.put("face", face); } - if (arch.isScripted()) { - final String events = arch.getMapArchEventData(); + if (gameObject.isScripted()) { + final String events = gameObject.getMapArchEventData(); if (!events.equals("")) { final String[] tmp = events.split("\n"); for (final String aTmp : tmp) { @@ -164,10 +163,10 @@ } } - if (arch.getMsgText() != null && !arch.getMsgText().trim().equals((defarch == null || defarch.getMsgText() == null) ? "" : defarch.getMsgText().trim())) { + if (gameObject.getMsgText() != null && !gameObject.getMsgText().trim().equals((archetype == null || archetype.getMsgText() == null) ? "" : archetype.getMsgText().trim())) { String msg = ""; - if (arch.getMsgText().trim().length() > 0) { - msg = arch.getMsgText(); + if (gameObject.getMsgText().trim().length() > 0) { + msg = gameObject.getMsgText(); if (!msg.endsWith("\n")) { msg += "\n"; } @@ -175,14 +174,14 @@ fields.put("msg", msg + "endmsg"); } - if (defarch != null && arch.getArchTypNr() != defarch.getArchTypNr()) { + if (archetype != null && gameObject.getArchTypNr() != archetype.getArchTypNr()) { // this arch has special type - if (arch.getObjectText().indexOf("type ") >= 0) { + if (gameObject.getObjectText().indexOf("type ") >= 0) { // oh oh - there might also be a type in the archtext which // is conflicting. remove the type from the archtext // open a reading stream for the archText - final StringReader sread = new StringReader(arch.getObjectText().toString()); + final StringReader sread = new StringReader(gameObject.getObjectText().toString()); final BufferedReader sstream = new BufferedReader(sread); String newArchtext = ""; @@ -208,9 +207,9 @@ sread.close(); if (newArchtext.trim().length() == 0) { - arch.setObjectText(""); + gameObject.setObjectText(""); } else { - arch.setObjectText(newArchtext.trim() + "\n"); + gameObject.setObjectText(newArchtext.trim() + "\n"); } } catch (final IOException e) { log.error("getSyntaxErrors: Cannot close StringReader"); @@ -218,10 +217,10 @@ } // now append the type to the archtext - fields.put("type", Integer.toString(arch.getArchTypNr())); + fields.put("type", Integer.toString(gameObject.getArchTypNr())); } - final String text = arch.getObjectText(); + final String text = gameObject.getObjectText(); if (!text.equals("")) { final String[] tmp = text.split("\n"); for (final String aTmp : tmp) { @@ -236,12 +235,12 @@ if (!isInventory) { // map coordinates only belong into map arches (not inventory arches) - final int x = arch.getMapX(); + final int x = gameObject.getMapX(); if (x != 0) { fields.put("x", Integer.toString(x)); } - final int y = arch.getMapY(); + final int y = gameObject.getMapY(); if (y != 0) { fields.put("y", Integer.toString(y)); } @@ -253,7 +252,7 @@ // Actually write the fields. try { - bufferedWriter.write("arch " + arch.getArchetypeName() + "\n"); + bufferedWriter.write("arch " + gameObject.getArchetypeName() + "\n"); for (int i = 0; i < keys.length; i++) { final String value = (String) fields.get(keys[i]); if (value != null) { @@ -266,7 +265,7 @@ } } - browseInvObjects(arch); // write his inventory inside this arch + browseInvObjects(gameObject); // write his inventory inside this arch bufferedWriter.write("end\n"); } catch (final IOException e) { Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-10-09 07:57:45 UTC (rev 511) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-10-09 08:17:02 UTC (rev 512) @@ -121,19 +121,19 @@ @Nullable private GameObject readArch(final BufferedReader myInput, String thisLine) throws IOException { boolean msgflag = false; boolean archflag = false; - GameObject arch = null; + GameObject gameObject = null; do { thisLine = thisLine.trim(); if (!archflag) { if (thisLine.startsWith("arch ")) { archflag = true; // from now on we are inside an arch - arch = new GameObject(); // create a new instance + gameObject = new GameObject(); // create a new instance // if this is still -1 in the post parse, we have no direction command loaded - arch.setDirection(-1); + gameObject.setDirection(-1); // our arch! it has a name! - arch.setArchetypeName(thisLine.substring("arch ".length()).trim()); + gameObject.setArchetypeName(thisLine.substring("arch ".length()).trim()); } } else { @@ -142,41 +142,41 @@ if (thisLine.startsWith("endmsg")) { msgflag = false; } else { - arch.addMsgText(thisLine + '\n'); + gameObject.addMsgText(thisLine + '\n'); } } else if (thisLine.startsWith("arch ")) { // ok, we had a full arch... don't care here about map or object // now we test for a new arch - thats stuf in inventory // or the end... thats the end of this shit //System.err.println("GO INVENTORY: " + arch + " - " + thisLine); - arch.addLast(readArch(myInput, thisLine)); + gameObject.addLast(readArch(myInput, thisLine)); //System.err.println("GO INVENTORY2: " + arch + " - " + thisLine); } else if (thisLine.startsWith("end")) { // chain this to temp list - objects.add(arch); + objects.add(gameObject); archflag = false; // System.err.println("LEAVE!: " + arch + " - " + thisLine); - return arch; + return gameObject; } else if (thisLine.startsWith("msg")) { - arch.addMsgText(""); + gameObject.addMsgText(""); msgflag = true; } else if (thisLine.startsWith("x ")) { - arch.setMapX(Integer.parseInt(thisLine.substring(2))); + gameObject.setMapX(Integer.parseInt(thisLine.substring(2))); } else if (thisLine.startsWith("y ")) { - arch.setMapY(Integer.parseInt(thisLine.substring(2))); + gameObject.setMapY(Integer.parseInt(thisLine.substring(2))); } else if (thisLine.startsWith("type ")) { // Arches in maps can override their default arch's type - arch.setArchTypNr(Integer.parseInt(thisLine.substring(5))); + gameObject.setArchTypNr(Integer.parseInt(thisLine.substring(5))); // don't load it into the archtext! (why?) } else if (thisLine.startsWith("direction ")) { - arch.setDirection(Integer.parseInt(thisLine.substring(10))); - arch.addObjectText(thisLine + '\n'); + gameObject.setDirection(Integer.parseInt(thisLine.substring(10))); + gameObject.addObjectText(thisLine + '\n'); } else if (thisLine.startsWith("face ")) { - arch.setFaceRealName(thisLine.substring("face ".length()).trim()); - arch.addObjectText(thisLine + '\n'); + gameObject.setFaceRealName(thisLine.substring("face ".length()).trim()); + gameObject.addObjectText(thisLine + '\n'); } else { - arch.addObjectText(thisLine + '\n'); + gameObject.addObjectText(thisLine + '\n'); } } } while ((thisLine = myInput.readLine()) != null); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-10-09 07:57:57
|
Revision: 511 http://svn.sourceforge.net/gridarta/?rev=511&view=rev Author: christianhujer Date: 2006-10-09 00:57:45 -0700 (Mon, 09 Oct 2006) Log Message: ----------- Set ignore properties. Property Changed: ---------------- trunk/crossfire/ trunk/daimonin/ trunk/daimonin/resource/toolbarButtonGraphics/misc/ trunk/daimonin/resource/toolbarButtonGraphics/navigation/ Property changes on: trunk/crossfire ___________________________________________________________________ Name: svn:ignore + developer.properties build.properties classes tags Property changes on: trunk/daimonin ___________________________________________________________________ Name: svn:ignore + tags classes update.properties build.properties developer.properties DaimoninEditor.jar Property changes on: trunk/daimonin/resource/toolbarButtonGraphics/misc ___________________________________________________________________ Name: svn:ignore + .xvpics Property changes on: trunk/daimonin/resource/toolbarButtonGraphics/navigation ___________________________________________________________________ Name: svn:ignore + .xvpics 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. |