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.archetype;
021
022import net.sf.gridarta.model.anim.AnimationObjects;
023import net.sf.gridarta.model.face.FaceObjectProviders;
024import net.sf.gridarta.model.gameobject.TestGameObject;
025import net.sf.gridarta.model.maparchobject.TestMapArchObject;
026import org.jetbrains.annotations.NotNull;
027
028/**
029 * An {@link ArchetypeFactory} implementation for testing purposes.
030 * @author Andreas Kirschbaum
031 */
032public class TestArchetypeFactory implements ArchetypeFactory<TestGameObject, TestMapArchObject, TestArchetype> {
033
034    /**
035     * The {@link FaceObjectProviders} instance.
036     */
037    @NotNull
038    private final FaceObjectProviders faceObjectProviders;
039
040    /**
041     * The {@link AnimationObjects} instance.
042     */
043    @NotNull
044    private final AnimationObjects animationObjects;
045
046    /**
047     * Creates a new instance.
048     * @param faceObjectProviders the face object providers instance
049     * @param animationObjects the animation objects instance
050     */
051    public TestArchetypeFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) {
052        this.faceObjectProviders = faceObjectProviders;
053        this.animationObjects = animationObjects;
054    }
055
056    /**
057     * {@inheritDoc}
058     */
059    @Override
060    @NotNull
061    public TestArchetype newUndefinedArchetype(@NotNull final String archetypeName) {
062        return new TestUndefinedArchetype(archetypeName, faceObjectProviders, animationObjects);
063    }
064
065}