001/*
002 * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
003 * Copyright (C) 2000-2010 The Gridarta Developers.
004 *
005 * This program is free software; you can redistribute it and/or modify
006 * it under the terms of the GNU General Public License as published by
007 * the Free Software Foundation; either version 2 of the License, or
008 * (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013 * GNU General Public License for more details.
014 *
015 * You should have received a copy of the GNU General Public License along
016 * with this program; if not, write to the Free Software Foundation, Inc.,
017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
018 */
019
020package net.sf.gridarta.model.io;
021
022import java.io.BufferedReader;
023import java.io.IOException;
024import java.util.List;
025import net.sf.gridarta.model.anim.AnimationObjects;
026import net.sf.gridarta.model.archetype.TestArchetype;
027import net.sf.gridarta.model.archetype.TestArchetypeBuilder;
028import net.sf.gridarta.model.archetypeset.ArchetypeSet;
029import net.sf.gridarta.model.errorview.ErrorViewCollector;
030import net.sf.gridarta.model.gameobject.TestGameObject;
031import net.sf.gridarta.model.maparchobject.TestMapArchObject;
032import org.jetbrains.annotations.NotNull;
033import org.jetbrains.annotations.Nullable;
034
035/**
036 * An {@link ArchetypeParser} for regression tests.
037 * @author Andreas Kirschbaum
038 */
039public class TestArchetypeParser extends AbstractArchetypeParser<TestGameObject, TestMapArchObject, TestArchetype, TestArchetypeBuilder> {
040
041    /**
042     * Creates an ArchetypeParser.
043     * @param archetypeBuilder the archetype builder to use
044     * @param animationObjects the animation objects instance to use
045     * @param archetypeSet the archetype set
046     */
047    public TestArchetypeParser(@NotNull final TestArchetypeBuilder archetypeBuilder, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet) {
048        super(archetypeBuilder, animationObjects, archetypeSet);
049    }
050
051    /**
052     * {@inheritDoc}
053     */
054    @Override
055    protected void initParseArchetype() {
056    }
057
058    /**
059     * {@inheritDoc}
060     */
061    @Override
062    protected boolean isStartLine(@NotNull final String line) {
063        return line.startsWith("Object");
064    }
065
066    /**
067     * {@inheritDoc}
068     */
069    @Override
070    protected boolean processLine(@NotNull final BufferedReader in, @NotNull final String line, @NotNull final String line2, @NotNull final TestArchetypeBuilder archetypeBuilder, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final List<TestGameObject> invObjects) throws IOException {
071        return false;
072    }
073
074    /**
075     * {@inheritDoc}
076     */
077    @Override
078    protected void finishParseArchetypePart(@Nullable final TestArchetype firstArch, @NotNull final TestArchetype archetype, @NotNull final ErrorViewCollector errorViewCollector) {
079    }
080
081    /**
082     * {@inheritDoc}
083     */
084    @Override
085    protected void finishParseArchetype(@NotNull final TestArchetype archetype) {
086    }
087
088    /**
089     * {@inheritDoc}
090     */
091    @Override
092    protected boolean addToPanel(final boolean isInternPath, @NotNull final String editorFolder, @NotNull final TestArchetype archetype) {
093        return true;
094    }
095
096}