From: <chr...@us...> - 2006-09-24 19:47:02
|
Revision: 406 http://svn.sourceforge.net/gridarta/?rev=406&view=rev Author: christianhujer Date: 2006-09-24 12:46:33 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Some unification work of cf/dai GameObject. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/CArchQuickView.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMapArchPanel.java trunk/daimonin/src/daieditor/CMapFileDecode.java trunk/daimonin/src/daieditor/CMapFileEncode.java trunk/daimonin/src/daieditor/CMapTileList.java trunk/daimonin/src/daieditor/CopyBuffer.java trunk/daimonin/src/daieditor/ReplaceDialog.java trunk/daimonin/src/daieditor/ScriptArchData.java trunk/daimonin/src/daieditor/gameobject/ArchObjectParser.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/gameobject/match/MutableNameGameObjectMatcher.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapControl.java Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-09-24 19:46:33 UTC (rev 406) @@ -79,26 +79,18 @@ private String objName; /** - * The objectText. - * <p/> - * It only contains the differences from the default arch. - * <p/> - * Note: It's a rule that every line ends with a '\n', including the last - * line. + * The objectText with the differences from the Archetype. + * @note Every line in the objectText must end on '\n', including the last line. */ - private StringBuffer objectText; + @NotNull private StringBuffer objectText; /** * The msgText. - * <p/> - * Note: It's a rule that every line ends with a '\n', including the last - * line. - * <p/> - * Another rule (unconfirmed): If the value is <code>null</code>, the arch - * has no message text, if the value exists but is empty, the arch has an - * empty message text. + * @note Every line in msgText must end on '\n', including the last line. + * @note If the value is <code>null</code>, the arch has no message text, + * if the value exists but is empty, the arch has an empty message text (unconfirmed). */ - private StringBuffer msgText; + @Nullable private StringBuffer msgText; private StringBuffer animText; // anim text buffer @@ -144,23 +136,26 @@ private boolean noface; // if true, arch has no face as default + /** + * If this flag is set, the arch is not a "real" arch but comes from the + * artifacts file. Such GameObject instances are not included in the arch + * collection, since the artifacts file is the same for editor and server. + */ + private boolean artifact; + private int facenr; // the index of faceImages[] private boolean editflag; // if true, object is in a editor - // for example in the map arch panel - private boolean artifact; // if set, this is not a "real" arch - // It will NOT be included in the arch collection - private GameObject next; // to chain ArchObjects in maps private GameObject prev; // same /** - * Enclosing container; if null, this object is not in a container but in a - * map. + * Container of this GameObject. + * The Crossfire implementation only knows <code>null</code> (map or unlinked) or being an inventory item. */ - private GameObject env = null; + private GameObject container = null; /** * All inventory objects. Set to {@link Collections#EMPTY_LIST} @@ -459,7 +454,7 @@ /** {@inheritDoc} */ public GameObject getContainer() { - return env; + return container; } /** {@inheritDoc} */ @@ -610,7 +605,7 @@ */ public void addInvObj(final GameObject arch) { // arch must not be already in a container - if (arch.env != null) { + if (arch.container != null) { throw new IllegalArgumentException(); } @@ -619,7 +614,7 @@ } inv.add(arch); - arch.env = this; + arch.container = this; arch.setMapX(getMapX()); arch.setMapY(getMapY()); @@ -633,17 +628,17 @@ } // object must be in a container - if (env == null) { + if (container == null) { throw new IllegalArgumentException(); } // remove this object from its parent container - if (!env.inv.remove(this)) { + if (!container.inv.remove(this)) { throw new AssertionError(); } - if (env.inv.size() == 0) { - env.inv = Collections.EMPTY_LIST; + if (container.inv.size() == 0) { + container.inv = Collections.EMPTY_LIST; } } Modified: trunk/daimonin/src/daieditor/CArchQuickView.java =================================================================== --- trunk/daimonin/src/daieditor/CArchQuickView.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/CArchQuickView.java 2006-09-24 19:46:33 UTC (rev 406) @@ -112,7 +112,7 @@ if (def == null || def == arch) { objName = null; } else if ((objName = def.getObjName()) != null && objName.length() != 0) { - } else if ((objName = def.getArchName()) != null && objName.length() != 0) { + } else if ((objName = def.getArchetypeName()) != null && objName.length() != 0) { } else { objName = null; } @@ -125,7 +125,7 @@ } archObjNameText.setText(objName); - archArchNameText.setText(arch.getArchName()); + archArchNameText.setText(arch.getArchetypeName()); archTypeText.setText(mainControl.getTypeList().getArchTypeName(arch.getArchTypNr()) + " (" + arch.getArchTypNr() + ')'); Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-09-24 19:46:33 UTC (rev 406) @@ -453,14 +453,14 @@ } else if (defarch.getObjName() != null && defarch.getObjName().length() > 0) { nameTF = new JTextField(defarch.getObjName(), 16); } else { - nameTF = new JTextField(defarch.getArchName(), 16); + nameTF = new JTextField(defarch.getArchetypeName(), 16); } nameTF.setEditable(false); header.add(nameTF, gbc); gbc.gridy++; header.add(buildTypesBox(), gbc); // build type-selection box gbc.gridy++; - defarchTF = new JTextField(defarch.getArchName(), 16); + defarchTF = new JTextField(defarch.getArchetypeName(), 16); defarchTF.setEditable(false); header.add(defarchTF, gbc); @@ -676,7 +676,7 @@ } else if (defarch.getObjName() != null && defarch.getObjName().length() > 0) { dtxt = defarch.getObjName(); } else { - dtxt = defarch.getArchName(); + dtxt = defarch.getArchetypeName(); } } else if ("face".equalsIgnoreCase(nameOld)) { if (arch.getFaceRealName() != null && arch.getFaceRealName().length() > 0) { @@ -1103,7 +1103,7 @@ } else { newName = ""; } - } else if (!inline.equalsIgnoreCase(defarch.getArchName())) { + } else if (!inline.equalsIgnoreCase(defarch.getArchetypeName())) { newName = inline; } else { newName = ""; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-09-24 19:46:33 UTC (rev 406) @@ -1294,9 +1294,9 @@ //noinspection ForLoopWithMissingComponent for (final Iterator<GameObject> it = objects.iterator(); it.hasNext();) { final GameObject arch = it.next(); - final GameObject defarch = archetypeSet.getArch(arch.getArchName()); + final GameObject defarch = archetypeSet.getArch(arch.getArchetypeName()); if (defarch == null) { - noarch.append(arch.getArchName()).append('\n'); + noarch.append(arch.getArchetypeName()).append('\n'); noarchcount++; it.remove(); } @@ -1906,7 +1906,7 @@ * if so, use the pickmap as random arch seed for the filler. */ if (arch != null) { - title.append("with arch ").append(arch.getArchName()); + title.append("with arch ").append(arch.getArchetypeName()); } else { pmap = CPickmapPanel.getInstance().getCurrentPickmap(); if (pmap != null) { Modified: trunk/daimonin/src/daieditor/CMapArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-09-24 19:46:33 UTC (rev 406) @@ -355,7 +355,7 @@ } else { arch.setObjName(archNameField.getText()); // overrule in map arch } - } else if (archNameField.getText().compareTo(arch.getArchName()) == 0) { + } else if (archNameField.getText().compareTo(arch.getArchetypeName()) == 0) { arch.setObjName(null); } else { // def is null, something is in panel, so we set it arch.setObjName(archNameField.getText()); // overrule in map arch @@ -843,8 +843,8 @@ archNameField.setForeground(black); if (defarch.getObjName() == null) { // arch name - if (arch.getArchName() != null) { - archNameField.setText(arch.getArchName()); + if (arch.getArchetypeName() != null) { + archNameField.setText(arch.getArchetypeName()); } else { archNameField.setText(""); } @@ -882,8 +882,8 @@ } if (arch.isInContainer()) { final GameObject cont = (GameObject) arch.getContainer(); - if (cont.getArchName() != null) { - specialText.append(" (env: ").append(cont.getArchName()).append(')'); + if (cont.getArchetypeName() != null) { + specialText.append(" (env: ").append(cont.getArchetypeName()).append(')'); } else { specialText.append(" (env: ><)"); } @@ -893,7 +893,7 @@ final StringBuilder typeText = new StringBuilder(); if (defarch != null) { - typeText.append("Type: ").append(mainControl.getTypeList().getArchTypeName(arch.getArchTypNr())).append(" (").append(arch.getArchTypNr()).append(") [").append(arch.getArchName()).append(']'); + typeText.append("Type: ").append(mainControl.getTypeList().getArchTypeName(arch.getArchTypNr())).append(" (").append(arch.getArchTypNr()).append(") [").append(arch.getArchetypeName()).append(']'); } else { typeText.append("Type: <unknown>"); } Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-09-24 19:46:33 UTC (rev 406) @@ -134,7 +134,7 @@ // if this is still -1 in the post parse, we have no direction command loaded arch.setDirection(-1); // our arch! it has a name! - arch.setArchName(thisLine.substring("arch ".length()).trim()); + arch.setArchetypeName(thisLine.substring("arch ".length()).trim()); } } else { Modified: trunk/daimonin/src/daieditor/CMapFileEncode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-09-24 19:46:33 UTC (rev 406) @@ -115,7 +115,7 @@ final GameObject defarch = arch.getArchetype(); // ok, we start with the standard parts... this is valid for all types - writer.write("arch " + arch.getArchName() + '\n'); + writer.write("arch " + arch.getArchetypeName() + '\n'); if (arch.getObjName() != null) { writer.write("name " + arch.getObjName() + '\n'); } Modified: trunk/daimonin/src/daieditor/CMapTileList.java =================================================================== --- trunk/daimonin/src/daieditor/CMapTileList.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/CMapTileList.java 2006-09-24 19:46:33 UTC (rev 406) @@ -205,7 +205,7 @@ if (newarch == null) { archname = null; } else { - archname = newarch.getArchName(); + archname = newarch.getArchetypeName(); } } @@ -461,7 +461,7 @@ if (defname != null && defname.length() > 0) { setText(defname); // default name } else { - setText(arch.getArchName()); // arch name + setText(arch.getArchetypeName()); // arch name } } } Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2006-09-24 19:46:33 UTC (rev 406) @@ -461,7 +461,7 @@ */ private void addArchToMap(final MapControl mapControl, final GameObject arch, final Point pos, final boolean allowDouble, final boolean fillBelow) { if (arch.isArchetype()) { - mapControl.getMapModel().addArchToMap(arch.getArchName(), pos, allowDouble, fillBelow); + mapControl.getMapModel().addArchToMap(arch.getArchetypeName(), pos, allowDouble, fillBelow); } else { final GameObject newHead = arch.createClone(pos.x, pos.y); for (GameObject tmp = arch.getArchetype().getMultiNext(); tmp != null; tmp = tmp.getMultiNext()) { Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-09-24 19:46:33 UTC (rev 406) @@ -316,7 +316,7 @@ for (MapSquare square : entireMap ? mapControl.getMapModel() : mapViewIFrame.getView().getSelectedSquares()) { for (GameObject node : square) { if (!node.isMulti() - && (matchCriteria == MATCH_ARCH_NAME && node.getArchName() != null && node.getArchName().equalsIgnoreCase(matchString) + && (matchCriteria == MATCH_ARCH_NAME && node.getArchetypeName() != null && node.getArchetypeName().equalsIgnoreCase(matchString) || matchCriteria == MATCH_OBJ_NAME && node.getBestName().equalsIgnoreCase(matchString))) { if (replaceListSize > 0 && !deleteOnly) { GameObject randomArch; Modified: trunk/daimonin/src/daieditor/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/ScriptArchData.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/ScriptArchData.java 2006-09-24 19:46:33 UTC (rev 406) @@ -588,7 +588,7 @@ ScriptedEvent(final int eventType, final String pluginName, final String filePath, final String options) { event = new GameObject(); // FIXME: This arch has no default arch event.setArchTypNr(118); - event.setArchName("event_obj"); + event.setArchetypeName("event_obj"); event.setArchetype(CMainControl.getInstance().getArchObjectStack().getArch("event_obj")); event.setObjectFace(); setEventData(eventType, pluginName, filePath, options); Modified: trunk/daimonin/src/daieditor/gameobject/ArchObjectParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchObjectParser.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/gameobject/ArchObjectParser.java 2006-09-24 19:46:33 UTC (rev 406) @@ -183,9 +183,9 @@ } if (archName == null) { - arch.setArchName(thisLine.substring(7)); + arch.setArchetypeName(thisLine.substring(7)); } else { - arch.setArchName(archName); + arch.setArchetypeName(archName); } multiShapeID = 0; @@ -200,15 +200,15 @@ } else if (animflag) { if (thisLine.startsWith("mina")) { try { - mainControl.getAnimationObjects().addAnimPath(arch.getArchName(), path.concat(arch.getArchName())); - mainControl.getAnimationObjects().addAnimationObject(arch.getArchName(), animText.toString()); + mainControl.getAnimationObjects().addAnimPath(arch.getArchetypeName(), path.concat(arch.getArchetypeName())); + mainControl.getAnimationObjects().addAnimationObject(arch.getArchetypeName(), animText.toString()); } catch (final DuplicateAnimationException e) { // TODO: Report to the user log.log(Level.WARNING, "duplicateAnimation", e); } - arch.addArchText("animation " + arch.getArchName() + "\n"); - arch.setAnimName(arch.getArchName()); + arch.addArchText("animation " + arch.getArchetypeName() + "\n"); + arch.setAnimName(arch.getArchetypeName()); // here we must add this to AnimationObject // and add Animation cmd here! @@ -220,7 +220,7 @@ log.log(Level.WARNING, "inventoryInDefArch", thisLine); } else if (thisLine.startsWith("end")) { //if (arch.getArchTypNr() == 0) { - //System.err.println("Arch "+ arch.getArchName()+" has no type info!"); + //System.err.println("Arch "+ arch.getArchetypeName()+" has no type info!"); //} // we got full arch parsearch = false; // we write this sucker @@ -233,7 +233,7 @@ if (firstArch.getMultiRefCount() == 2) { firstArch.setMultiShapeID(multiShapeID); } else if (multiShapeID != firstArch.getMultiShapeID()) { - log.log(Level.WARNING, "defArchWithInvalidMpartNr", new Object[]{arch.getArchName(), firstArch.getArchName(), Integer.toString(multiShapeID), Integer.toString(firstArch.getMultiShapeID())}); + log.log(Level.WARNING, "defArchWithInvalidMpartNr", new Object[]{arch.getArchetypeName(), firstArch.getArchetypeName(), Integer.toString(multiShapeID), Integer.toString(firstArch.getMultiShapeID())}); } } else { mainControl.incArchObjCount(); @@ -243,7 +243,7 @@ if (!ArchetypeSet.isLoadedFromArchive() || archName != null) { // loading from individual files, so we simply add it to list // ArchetypeSet.loadArchFromFiles() takes care of the panels - mainControl.addArchPanelArch(arch.getArchName(), index); + mainControl.addArchPanelArch(arch.getArchetypeName(), index); } else { // loading from collected files, so we need process panels here // FIXME this sucks. This takes 50% of the time of collecting arches!!! @@ -287,7 +287,7 @@ isNewCategory = false; oldCat = newCat; } - mainControl.addArchPanelArch(arch.getArchName(), index); + mainControl.addArchPanelArch(arch.getArchetypeName(), index); } } } @@ -327,23 +327,23 @@ animflag = true; animText = new StringBuilder(); } else if (thisLine.startsWith("visibility ")) { - // System.err.println("Remove visibility: "+arch.getArchName()); + // System.err.println("Remove visibility: "+arch.getArchetypeName()); } else if (thisLine.startsWith("magicmap ")) { - // System.err.println("Remove magicmap: "+arch.getArchName()); + // System.err.println("Remove magicmap: "+arch.getArchetypeName()); } else if (thisLine.startsWith("color_fg ")) { - // System.err.println("Remove color_fg: "+arch.getArchName()); + // System.err.println("Remove color_fg: "+arch.getArchetypeName()); } else if (thisLine.startsWith("color_bg ")) { - // System.err.println("Remove color_bg: "+arch.getArchName()); + // System.err.println("Remove color_bg: "+arch.getArchetypeName()); } else if (thisLine.startsWith("x ")) { - if (!archmore && !arch.getArchName().equals(STARTARCH_NAME)) { - log.log(Level.WARNING, "foundCoordInDefArchSingleTileOrHead", new Object[]{"x", arch.getArchName()}); + if (!archmore && !arch.getArchetypeName().equals(STARTARCH_NAME)) { + log.log(Level.WARNING, "foundCoordInDefArchSingleTileOrHead", new Object[]{"x", arch.getArchetypeName()}); arch.addArchText(thisLine + "\n"); } else { arch.setMultiX(Integer.parseInt(thisLine.substring(2))); } } else if (thisLine.startsWith("y ")) { - if (!archmore && !arch.getArchName().equals(STARTARCH_NAME)) { - log.log(Level.WARNING, "foundCoordInDefArchSingleTileOrHead", new Object[]{"y", arch.getArchName()}); + if (!archmore && !arch.getArchetypeName().equals(STARTARCH_NAME)) { + log.log(Level.WARNING, "foundCoordInDefArchSingleTileOrHead", new Object[]{"y", arch.getArchetypeName()}); arch.addArchText(thisLine + "\n"); } else { arch.setMultiY(Integer.parseInt(thisLine.substring(2))); @@ -353,17 +353,17 @@ final int i = Integer.parseInt(thisLine.substring(5)); arch.setArchTypNr(i); if (i == 0) { - log.log(Level.WARNING, "defArchWithZeroType", arch.getArchName()); + log.log(Level.WARNING, "defArchWithZeroType", arch.getArchetypeName()); } } catch (final NumberFormatException e) { - log.log(Level.WARNING, "defArchWithInvalidTypeNr", new Object[]{arch.getArchName(), thisLine.substring(5)}); + log.log(Level.WARNING, "defArchWithInvalidTypeNr", new Object[]{arch.getArchetypeName(), thisLine.substring(5)}); arch.addArchText(thisLine + "\n"); } } else if (thisLine.startsWith("direction ")) { try { arch.setDirection(Integer.parseInt(thisLine.substring(10))); } catch (final NumberFormatException e) { - log.log(Level.WARNING, "defArchWithInvalidDirection", new Object[]{arch.getArchName(), thisLine.substring(10)}); + log.log(Level.WARNING, "defArchWithInvalidDirection", new Object[]{arch.getArchetypeName(), thisLine.substring(10)}); } arch.addArchText(thisLine + "\n"); } else if (thisLine.startsWith("face ")) { @@ -387,10 +387,10 @@ multiShapeID = Integer.parseInt(thisLine.substring(9).trim()); if (multiShapeID <= 0 || multiShapeID >= MultiPositionData.Y_DIM) { - System.err.println("WARNING: Arch " + arch.getArchName() + " mpart_id number is '" + thisLine.substring(9) + '\''); + System.err.println("WARNING: Arch " + arch.getArchetypeName() + " mpart_id number is '" + thisLine.substring(9) + '\''); } } catch (final NumberFormatException e) { - System.err.println("WARNING: Arch " + arch.getArchName() + " has a invalid mpart_id (" + thisLine.substring(9) + ')'); + System.err.println("WARNING: Arch " + arch.getArchetypeName() + " has a invalid mpart_id (" + thisLine.substring(9) + ')'); arch.addArchText(thisLine + "\n"); } } else if (thisLine.startsWith("mpart_nr ")) { @@ -399,7 +399,7 @@ final int i = Integer.parseInt(thisLine.substring(9).trim()); arch.setMultiPartNr(i); } catch (final NumberFormatException e) { - System.err.println("WARNING: Arch " + arch.getArchName() + " has a invalid mpart_nr (" + thisLine.substring(9) + ')'); + System.err.println("WARNING: Arch " + arch.getArchetypeName() + " has a invalid mpart_nr (" + thisLine.substring(9) + ')'); arch.addArchText(thisLine + "\n"); } } else { Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-09-24 19:46:33 UTC (rev 406) @@ -184,12 +184,12 @@ * @todo check whether the GameObject is a default arch and reject no default arches with an exception */ public void addArchToList(final GameObject data) /*throws DuplicateArchException*/ { - if (arches.containsKey(data.getArchName())) { - ACTION_FACTORY.showMessageDialog(mainControl.getMainView(), "loadDuplicateArch", data.getArchName(), currentFile); + if (arches.containsKey(data.getArchetypeName())) { + ACTION_FACTORY.showMessageDialog(mainControl.getMainView(), "loadDuplicateArch", data.getArchetypeName(), currentFile); //throw new DuplicateArchException(data); } else { archObjects.add(data); - arches.put(data.getArchName(), data); + arches.put(data.getArchetypeName(), data); } } @@ -569,15 +569,15 @@ artifactCount++; continue; } - if (arch.getArchName().compareTo(ArchObjectParser.STARTARCH_NAME) == 0) { + if (arch.getArchetypeName().compareTo(ArchObjectParser.STARTARCH_NAME) == 0) { // process map arch - out.append("Object ").append(arch.getArchName()).append('\n'); + out.append("Object ").append(arch.getArchetypeName()).append('\n'); // map object hack: x/y is normally a reference for multi // part arches - i include this hack until we rework the // arch objects with more useful script names - if (arch.getArchName().equals(ArchObjectParser.STARTARCH_NAME)) { + if (arch.getArchetypeName().equals(ArchObjectParser.STARTARCH_NAME)) { out.append("x ").append(Integer.toString(arch.getMultiX())).append('\n'); out.append("y ").append(Integer.toString(arch.getMultiY())).append('\n'); } @@ -603,7 +603,7 @@ continue; //ACTION_FACTORY.showMessageDialog(pbar.getParentComponent(), WARNING_MESSAGE, "archCollectWarningMultipartTailInPanel"); } - out.append("Object ").append(arch.getArchName()).append('\n'); + out.append("Object ").append(arch.getArchetypeName()).append('\n'); if (arch.getObjName() != null) { out.append("name ").append(arch.getObjName()).append('\n'); @@ -652,7 +652,7 @@ out.append("More\n"); - out.append("Object ").append(tail.getArchName()).append('\n'); + out.append("Object ").append(tail.getArchetypeName()).append('\n'); if (tail.getObjName() != null) { out.append("name ").append(tail.getObjName()).append('\n'); Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-09-24 19:46:33 UTC (rev 406) @@ -72,7 +72,7 @@ private String faceRealName; /** Arch name. */ - private String archName; + private String archetypeName; /** The name of this object. */ private String objName; @@ -81,7 +81,7 @@ private String animName; /** - * The objectText with the differences from the default arch. + * The objectText with the differences from the Archetype. * @note Every line in the objectText must end on '\n', including the last line. */ @NotNull private StringBuffer objectText; @@ -136,6 +136,15 @@ */ private ScriptArchData script; + private boolean noface; + + /** + * If this flag is set, the arch is not a "real" arch but comes from the + * artifacts file. Such GameObject instances are not included in the arch + * collection, since the artifacts file is the same for editor and server. + */ + private boolean artifact; + /** State where the face comes from. */ private FaceDesc faceobjdesc; @@ -147,16 +156,7 @@ private int direction; - private boolean noface; - /** - * If this flag is set, the arch is not a "real" arch but comes from the - * artifacts file. Such GameObject instances are not included in the arch - * collection, since the artifacts file is the same for editor and server. - */ - private boolean artifact; - - /** * Container of this GameObject. * There are two possibilities for the container: * <ul> @@ -800,18 +800,18 @@ /** * Sets arch name. - * @param archName arch name + * @param archetypeName arch name */ - public void setArchName(final String archName) { - this.archName = archName != null ? archName.intern() : null; + public void setArchetypeName(final String archetypeName) { + this.archetypeName = archetypeName != null ? archetypeName.intern() : null; } /** * Returns arch name. * @return the arch name */ - public String getArchName() { - return archName; + public String getArchetypeName() { + return archetypeName; } /** @@ -824,10 +824,10 @@ return objName; } else if (archetype != null && archetype.objName != null && archetype.objName.length() > 0) { return archetype.objName; - } else if (archName != null && archName.length() > 0) { - return archName; - } else if (archetype != null && archetype.archName != null) { - return archetype.archName; + } 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 @@ -1188,7 +1188,7 @@ /** @return true when this arch has one or more scripted events defined */ public boolean isScripted() { - for (GameObject tmp : this) { + for (final GameObject tmp : this) { if (tmp.archType == 118) { return true; } @@ -1323,7 +1323,7 @@ return archetype.createArch(); } final GameObject arch = new GameObject(); - arch.setArchName(archName); + arch.setArchetypeName(archetypeName); arch.setArchetype(this); arch.setObjectFace(); arch.setMultiX(multiX); Modified: trunk/daimonin/src/daieditor/gameobject/match/MutableNameGameObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/match/MutableNameGameObjectMatcher.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/gameobject/match/MutableNameGameObjectMatcher.java 2006-09-24 19:46:33 UTC (rev 406) @@ -47,7 +47,7 @@ /** {@inheritDoc} */ public boolean isMatching(final GameObject arch) { - return name.matches(arch.getArchName()); + return name.matches(arch.getArchetypeName()); } /** Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-09-24 19:46:33 UTC (rev 406) @@ -234,7 +234,7 @@ if (!allowDouble) { for (final GameObject node : mapGrid[mapT.x][mapT.y]) { - if (node.getArchName().equals(tail.getArchName())) { + if (node.getArchetypeName().equals(tail.getArchetypeName())) { return false; } } @@ -307,7 +307,7 @@ if (newarch == null || newarch.isArchetype()) { // just make sure we never insert an uninitialized default arch from the stack if (newarch != null && newarch.isArchetype()) { - archname = newarch.getArchName(); + archname = newarch.getArchetypeName(); } // insert a new instance of the default arch (number 'archnr') if (!addArchToMap(archname, pos, true, false)) { @@ -340,7 +340,7 @@ final GameObject invnew; // new arch to be inserted if (newarch == null || newarch.isArchetype()) { if (newarch != null && newarch.isArchetype()) { - archname = newarch.getArchName(); + archname = newarch.getArchetypeName(); } // create a new copy of a default arch invnew = getDefaultArch(archname).createArch(); Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2006-09-24 19:27:28 UTC (rev 405) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2006-09-24 19:46:33 UTC (rev 406) @@ -480,7 +480,7 @@ // insert multi tile from pickmap: newarch = newarch.getHead(); // first insert default arch from archlist - if (!mapModel.addArchToMap(newarch.getArchName(), p, allowMany, false)) { + if (!mapModel.addArchToMap(newarch.getArchetypeName(), p, allowMany, false)) { // do nothing } else { // insertion successful, now get redraw info @@ -532,7 +532,7 @@ } // first insert default arch from archlist - if (!allSpacesFree || !mapModel.addArchToMap(newarch.getArchName(), p, true, false)) { + if (!allSpacesFree || !mapModel.addArchToMap(newarch.getArchetypeName(), p, true, false)) { // do nothing } else { // insertion successful, now get redraw info This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |