From: <aki...@us...> - 2011-12-17 07:43:49
|
Revision: 9128 http://gridarta.svn.sourceforge.net/gridarta/?rev=9128&view=rev Author: akirschbaum Date: 2011-12-17 07:43:37 +0000 (Sat, 17 Dec 2011) Log Message: ----------- Remove unneeded code. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/model/src/test/net/sf/gridarta/model/archetype/ArchetypeParserTest.java trunk/model/src/test/net/sf/gridarta/model/artifact/TestParser.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java trunk/model/src/test/net/sf/gridarta/model/resource/AbstractFilesResourcesReaderTest.java Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/archetype/DefaultArchetypeSet.java Removed Paths: ------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/archetype/ArchetypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeSet.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeSet.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-12-17 07:26:00 UTC (rev 9127) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-12-17 07:43:37 UTC (rev 9128) @@ -47,6 +47,8 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeFactory; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.model.archetypetype.ArchetypeTypeList; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; @@ -107,7 +109,6 @@ import net.sf.gridarta.var.atrinik.gui.scripts.DefaultScriptArchUtils; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; import net.sf.gridarta.var.atrinik.model.archetype.ArchetypeParser; -import net.sf.gridarta.var.atrinik.model.archetype.ArchetypeSet; import net.sf.gridarta.var.atrinik.model.archetype.DefaultArchetypeFactory; import net.sf.gridarta.var.atrinik.model.gameobject.DefaultGameObjectFactory; import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; @@ -177,7 +178,7 @@ */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); } @@ -221,7 +222,7 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { return new DefaultGameObjectParserFactory(gameObjectFactory, archetypeSet); } @@ -248,8 +249,8 @@ */ @NotNull @Override - public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - return new ArchetypeSet(archetypeFactory, faceObjectProviders); + public ArchetypeSet<GameObject, MapArchObject, Archetype> newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + return new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null, faceObjectProviders); } /** @@ -363,7 +364,7 @@ * {@inheritDoc} */ @Override - public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { + public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { try { final URL url = IOUtils.getResource(globalSettings.getConfigurationDirectory(), IGUIConstants.ARCHDEF_FILE); multiPositionData.load(errorView, url); @@ -387,7 +388,7 @@ */ @NotNull @Override - public ScriptedEventFactory<GameObject, MapArchObject, Archetype> newScriptedEventFactory(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public ScriptedEventFactory<GameObject, MapArchObject, Archetype> newScriptedEventFactory(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { return new DefaultScriptedEventFactory(scriptArchUtils, "sub_type", gameObjectFactory, scriptedEventEditor, archetypeSet); } @@ -468,7 +469,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(GuiFileFilters.pythonFileFilter, ".py", true, mapManager, pickmapManager, archetypeSet, mapModelFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "AtrinikEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubDirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, pluginExecutor, pluginParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, -1, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, pluginModel, animationObjects, archetypeChooserModel, false, scriptedEventEditor, new Direction[] { Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH, }, resources, gameObjectSpells, numberSpells, pluginParameterFactory); } @@ -477,7 +478,7 @@ */ @NotNull @Override - public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { return new DefaultResources(gameObjectParser, archetypeSet, archetypeParser, mapViewSettings, faceObjects, animationObjects, archFaceProvider, faceObjectProviders); } Deleted: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java 2011-12-17 07:26:00 UTC (rev 9127) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeSet.java 2011-12-17 07:43:37 UTC (rev 9128) @@ -1,46 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.var.atrinik.model.archetype; - -import net.sf.gridarta.model.archetype.AbstractArchetypeSet; -import net.sf.gridarta.model.archetype.ArchetypeFactory; -import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.var.atrinik.model.gameobject.GameObject; -import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; - -/** - * The <code>ArchetypeSet</code> contains all the Archetypes. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class ArchetypeSet extends AbstractArchetypeSet<GameObject, MapArchObject, Archetype> { - - /** - * Create the ArchetypeSet. - * @param archetypeFactory the archetype factory instance to use - * @param faceObjectProviders the face object providers - */ - public ArchetypeSet(@NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - super(archetypeFactory, null, faceObjectProviders); - } - -} // class ArchetypeSet Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 07:26:00 UTC (rev 9127) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-12-17 07:43:37 UTC (rev 9128) @@ -25,6 +25,8 @@ import net.sf.gridarta.model.archetype.AbstractArchetypeBuilder; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.AbstractArchetypeParserTest; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetype.UndefinedArchetypeException; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.baseobject.BaseObject; @@ -58,7 +60,7 @@ * The loaded archetypes. */ @Nullable - private ArchetypeSet archetypeSet = null; + private ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet = null; /** * Checks that mpart_id fields are parsed correctly. @@ -146,7 +148,7 @@ final ArchetypeTypeSet archetypeTypeSet = new ArchetypeTypeSet(); final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects, archetypeTypeSet); final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); - archetypeSet = new ArchetypeSet(archetypeFactory, faceObjectProviders); + archetypeSet = new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null, faceObjectProviders); archetypeSet.setLoadedFromArchive(true); assert archetypeSet != null; final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, archetypeSet); @@ -163,7 +165,7 @@ @NotNull @Override @SuppressWarnings("NullableProblems") - protected ArchetypeSet getArchetypeSet() { + protected ArchetypeSet<GameObject, MapArchObject, Archetype> getArchetypeSet() { if (archetypeSet == null) { throw new IllegalStateException(); } Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-12-17 07:26:00 UTC (rev 9127) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-12-17 07:43:37 UTC (rev 9128) @@ -45,6 +45,8 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeFactory; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.model.archetypetype.ArchetypeTypeList; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; @@ -81,6 +83,7 @@ import net.sf.gridarta.model.scripts.ScriptArchUtils; import net.sf.gridarta.model.scripts.ScriptedEventFactory; import net.sf.gridarta.model.settings.GlobalSettings; +import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.gridarta.model.spells.GameObjectSpell; import net.sf.gridarta.model.spells.NumberSpell; import net.sf.gridarta.model.spells.Spells; @@ -102,7 +105,6 @@ import net.sf.gridarta.var.crossfire.gui.scripts.DefaultScriptArchUtils; import net.sf.gridarta.var.crossfire.model.archetype.Archetype; import net.sf.gridarta.var.crossfire.model.archetype.ArchetypeParser; -import net.sf.gridarta.var.crossfire.model.archetype.ArchetypeSet; import net.sf.gridarta.var.crossfire.model.archetype.DefaultArchetypeFactory; import net.sf.gridarta.var.crossfire.model.gameobject.DefaultGameObjectFactory; import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; @@ -113,7 +115,6 @@ import net.sf.gridarta.var.crossfire.model.mapcontrol.DefaultMapControlFactory; import net.sf.gridarta.var.crossfire.model.scripts.DefaultScriptedEventFactory; import net.sf.gridarta.var.crossfire.model.settings.DefaultGlobalSettings; -import net.sf.gridarta.model.smoothface.SmoothFaces; import net.sf.gridarta.var.crossfire.resource.DefaultResources; import net.sf.japi.swing.prefs.PreferencesGroup; import org.apache.log4j.Category; @@ -148,7 +149,7 @@ */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, IGUIConstants.SCRIPTS_DIR, errorView, this, false, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); } @@ -192,7 +193,7 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { return new DefaultGameObjectParserFactory(gameObjectFactory, archetypeSet); } @@ -219,8 +220,9 @@ */ @NotNull @Override - public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - return new ArchetypeSet(globalSettings.getImageSet(), archetypeFactory, faceObjectProviders); + public ArchetypeSet<GameObject, MapArchObject, Archetype> newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + final String imageSet = globalSettings.getImageSet(); + return new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, imageSet.equals("none") ? null : imageSet, faceObjectProviders); } /** @@ -271,7 +273,7 @@ * {@inheritDoc} */ @Override - public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { + public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { if (smoothFaces == null) { throw new IllegalStateException(); } @@ -292,7 +294,7 @@ */ @NotNull @Override - public ScriptedEventFactory<GameObject, MapArchObject, Archetype> newScriptedEventFactory(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public ScriptedEventFactory<GameObject, MapArchObject, Archetype> newScriptedEventFactory(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { return new DefaultScriptedEventFactory(scriptArchUtils, "subtype", gameObjectFactory, scriptedEventEditor, archetypeSet); } @@ -377,7 +379,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(GuiFileFilters.pythonFileFilter, ".py", false, mapManager, pickmapManager, archetypeSet, mapModelFactory, null, "CrossfireEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, null, this, errorView, new DirectoryCacheFiles(ConfigFileUtils.getHomeFile("thumbnails"), ".png"), configSourceFactory, rendererFactory, filterControl, pluginExecutor, pluginParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, systemIcons, 0, archetypeTypeSet, mapArchObjectFactory, mapReaderFactory, validators, gameObjectMatchers, IGUIConstants.SCRIPTS_DIR, pluginModel, animationObjects, archetypeChooserModel, true, scriptedEventEditor, new Direction[] { Direction.NORTH, Direction.EAST, Direction.SOUTH, Direction.WEST, Direction.NORTH_EAST, Direction.SOUTH_EAST, Direction.SOUTH_WEST, Direction.NORTH_WEST, }, resources, gameObjectSpells, numberSpells, pluginParameterFactory); } @@ -386,7 +388,7 @@ */ @NotNull @Override - public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { + public AbstractResources<GameObject, MapArchObject, Archetype> newResources(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ?> archetypeParser, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final FaceObjectProviders faceObjectProviders) { if (smoothFaces == null) { throw new IllegalStateException(); } Deleted: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java 2011-12-17 07:26:00 UTC (rev 9127) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeSet.java 2011-12-17 07:43:37 UTC (rev 9128) @@ -1,47 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2010 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.var.crossfire.model.archetype; - -import net.sf.gridarta.model.archetype.AbstractArchetypeSet; -import net.sf.gridarta.model.archetype.ArchetypeFactory; -import net.sf.gridarta.model.face.FaceObjectProviders; -import net.sf.gridarta.var.crossfire.model.gameobject.GameObject; -import net.sf.gridarta.var.crossfire.model.maparchobject.MapArchObject; -import org.jetbrains.annotations.NotNull; - -/** - * The <code>ArchetypeSet</code> contains all the Archetypes. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:and...@gm...">Andreas Vogl</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class ArchetypeSet extends AbstractArchetypeSet<GameObject, MapArchObject, Archetype> { - - /** - * Create the ArchetypeSet. - * @param imageSet the image set to use - * @param archetypeFactory the archetype factory to use - * @param faceObjectProviders the face object providers - */ - public ArchetypeSet(@NotNull final String imageSet, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - super(archetypeFactory, imageSet.equals("none") ? null : imageSet, faceObjectProviders); - } - -} // class ArchetypeSet Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 07:26:00 UTC (rev 9127) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-12-17 07:43:37 UTC (rev 9128) @@ -25,6 +25,8 @@ import net.sf.gridarta.model.archetype.AbstractArchetypeBuilder; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.AbstractArchetypeParserTest; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetype.UndefinedArchetypeException; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.DefaultFaceObjects; @@ -57,7 +59,7 @@ * The loaded archetypes. */ @Nullable - private ArchetypeSet archetypeSet = null; + private ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet = null; /** * Checks that inventory game objects are recognized. @@ -104,7 +106,7 @@ final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects = new DefaultAnimationObjects<GameObject, MapArchObject, Archetype>(); final DefaultGameObjectFactory gameObjectFactory = new DefaultGameObjectFactory(faceObjectProviders, animationObjects); final DefaultArchetypeFactory archetypeFactory = new DefaultArchetypeFactory(faceObjectProviders, animationObjects); - archetypeSet = new ArchetypeSet("images", archetypeFactory, faceObjectProviders); + archetypeSet = new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, "images", faceObjectProviders); archetypeSet.setLoadedFromArchive(true); assert archetypeSet != null; final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser = new DefaultGameObjectParser(gameObjectFactory, archetypeSet); @@ -120,7 +122,7 @@ @NotNull @Override @SuppressWarnings("NullableProblems") - protected ArchetypeSet getArchetypeSet() { + protected ArchetypeSet<GameObject, MapArchObject, Archetype> getArchetypeSet() { if (archetypeSet == null) { throw new IllegalStateException(); } Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2011-12-17 07:26:00 UTC (rev 9127) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2011-12-17 07:43:37 UTC (rev 9128) @@ -47,6 +47,8 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetype.AbstractArchetypeParser; import net.sf.gridarta.model.archetype.ArchetypeFactory; +import net.sf.gridarta.model.archetype.ArchetypeSet; +import net.sf.gridarta.model.archetype.DefaultArchetypeSet; import net.sf.gridarta.model.archetypechooser.ArchetypeChooserModel; import net.sf.gridarta.model.archetypetype.ArchetypeTypeList; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; @@ -107,7 +109,6 @@ import net.sf.gridarta.var.daimonin.gui.scripts.DefaultScriptArchUtils; import net.sf.gridarta.var.daimonin.model.archetype.Archetype; import net.sf.gridarta.var.daimonin.model.archetype.ArchetypeParser; -import net.sf.gridarta.var.daimonin.model.archetype.ArchetypeSet; import net.sf.gridarta.var.daimonin.model.archetype.DefaultArchetypeFactory; import net.sf.gridarta.var.daimonin.model.gameobject.DefaultGameObjectFactory; import net.sf.gridarta.var.daimonin.model.gameobject.GameObject; @@ -177,7 +178,7 @@ */ @NotNull @Override - public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { + public DefaultMainControl<GameObject, MapArchObject, Archetype> newMainControl(final boolean forceReadFromFiles, @NotNull final ErrorView errorView, @NotNull final GlobalSettings globalSettings, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final PathManager pathManager, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final AutojoinLists<GameObject, MapArchObject, Archetype> autojoinLists, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory, @NotNull final ValidatorPreferences validatorPreferences, @NotNull final MapWriter<GameObject, MapArchObject, Archetype> mapWriter) { return new DefaultMainControl<GameObject, MapArchObject, Archetype>(GuiFileFilters.luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, IGUIConstants.SCRIPTS_DIR, errorView, this, forceReadFromFiles, globalSettings, configSourceFactory, pathManager, gameObjectMatchers, gameObjectFactory, archetypeTypeSet, archetypeSet, archetypeChooserModel, autojoinLists, mapManager, pluginModel, validators, scriptedEventEditor, resources, numberSpells, gameObjectSpells, pluginParameterFactory, validatorPreferences, mapWriter); } @@ -221,7 +222,7 @@ */ @NotNull @Override - public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public GameObjectParserFactory<GameObject, MapArchObject, Archetype> newGameObjectParserFactory(@NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { return new DefaultGameObjectParserFactory(gameObjectFactory, archetypeSet); } @@ -248,8 +249,8 @@ */ @NotNull @Override - public ArchetypeSet newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { - return new ArchetypeSet(archetypeFactory, faceObjectProviders); + public ArchetypeSet<GameObject, MapArchObject, Archetype> newArchetypeSet(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeFactory<GameObject, MapArchObject, Archetype> archetypeFactory, @NotNull final FaceObjectProviders faceObjectProviders) { + return new DefaultArchetypeSet<GameObject, MapArchObject, Archetype>(archetypeFactory, null, faceObjectProviders); } /** @@ -363,7 +364,7 @@ * {@inheritDoc} */ @Override - public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { + public ArchetypeParser newArchetypeParser(@NotNull final ErrorView errorView, final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final GlobalSettings globalSettings) { try { final URL url = IOUtils.getResource(globalSettings.getConfigurationDirectory(), IGUIConstants.ARCHDEF_FILE); multiPositionData.load(errorView, url); @@ -387,7 +388,7 @@ */ @NotNull @Override - public ScriptedEventFactory<GameObject, MapArchObject, Archetype> newScriptedEventFactory(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + public ScriptedEventFactory<GameObject, MapArchObject, Archetype> newScriptedEventFactory(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { return new DefaultScriptedEventFactory(scriptArchUtils, "sub_type", gameObjectFactory, scriptedEventEditor, archetypeSet); } @@ -468,7 +469,7 @@ */ @NotNull @Override - public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final net.sf.gridarta.model.archetype.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { + public GUIMainControl<GameObject, MapArchObject, Archetype> createGUIMainControl(@NotNull final DefaultMainControl<GameObject, MapArchObject, Archetype> mainControl, @NotNull final ErrorView errorView, @NotNull final GUIUtils guiUtils, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final RendererFactory<GameObject, MapArchObject, Archetype> rendererFactory, @NotNull final FilterControl<GameObject, MapArchObject, Archetype> filterControl, @NotNull final PluginExecutor<GameObject, MapArchObject, Archetype> pluginExecutor, @NotNull final PluginParameters pluginParameters, @NotNull final AbstractMapManager<GameObject, MapArchObject, Archetype> mapManager, @NotNull final MapManager<GameObject, MapArchObject, Archetype> pickmapManager, @NotNull final MapModelFactory<GameObject, MapArchObject, Archetype> mapModelFactory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects, @NotNull final GlobalSettings globalSettings, @NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final PathManager pathManager, @NotNull final InsertionMode<GameObject, MapArchObject, Archetype> topmostInsertionMode, @NotNull final GameObjectFactory<GameObject, MapArchObject, Archetype> gameObjectFactory, @NotNull final SystemIcons systemIcons, @NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final DefaultMapReaderFactory<GameObject, MapArchObject, Archetype> mapReaderFactory, @NotNull final DelegatingMapValidator<GameObject, MapArchObject, Archetype> validators, @NotNull final GameObjectMatchers gameObjectMatchers, @NotNull final PluginModel<GameObject, MapArchObject, Archetype> pluginModel, @NotNull final AnimationObjects<GameObject, MapArchObject, Archetype> animationObjects, @NotNull final ArchetypeChooserModel<GameObject, MapArchObject, Archetype> archetypeChooserModel, @NotNull final ScriptedEventEditor<GameObject, MapArchObject, Archetype> scriptedEventEditor, @NotNull final AbstractResources<GameObject, MapArchObject, Archetype> resources, @NotNull final Spells<NumberSpell> numberSpells, @NotNull final Spells<GameObjectSpell<GameObject, MapArchObject, Archetype>> gameObjectSpells, @NotNull final PluginParameterFactory<GameObject, MapArchObject, Archetype> pluginParameterFactory) { return mainControl.createGUIMainControl(GuiFileFilters.luaFileFilter, ".lua", true, mapManager, pickmapManager, archetypeSet, mapModelFactory, guiUtils.getResourceIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFERENCES_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SPELL_FILE, this, errorView, new SubDirectoryCacheFiles(".dedit"), configSourceFactory, rendererFactory, filterControl, pluginExecutor, pluginParameters, faceObjects, globalSettings, mapViewSettings, faceObjectProviders, pathManager, topmostInsertionMode, gameObjectFactory, ... [truncated message content] |