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.archetypetype;
021
022import org.jetbrains.annotations.NotNull;
023import org.jetbrains.annotations.Nullable;
024
025/**
026 * An {@link ArchetypeAttributeFactory} suitable for unit tests.
027 * @author Andreas Kirschbaum
028 */
029public class TestArchetypeAttributeFactory implements ArchetypeAttributeFactory {
030
031    /**
032     * {@inheritDoc}
033     */
034    @NotNull
035    @Override
036    public ArchetypeAttribute newArchetypeAttributeAnimname(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
037        return new TestArchetypeAttribute("animname", archetypeAttributeName, attributeName, description, inputLength);
038    }
039
040    /**
041     * {@inheritDoc}
042     */
043    @NotNull
044    @Override
045    public ArchetypeAttribute newArchetypeAttributeBitmask(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength, @NotNull final String bitmaskName) {
046        return new TestArchetypeAttribute("bitmask", archetypeAttributeName, attributeName, description, inputLength);
047    }
048
049    /**
050     * {@inheritDoc}
051     */
052    @NotNull
053    @Override
054    public ArchetypeAttribute newArchetypeAttributeBool(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
055        return new TestArchetypeAttribute("bool", archetypeAttributeName, attributeName, description, inputLength);
056    }
057
058    /**
059     * {@inheritDoc}
060     */
061    @NotNull
062    @Override
063    public ArchetypeAttribute newArchetypeAttributeBoolSpec(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength, @NotNull final String trueValue, @NotNull final String falseValue) {
064        return new TestArchetypeAttribute("bool_spec", archetypeAttributeName, attributeName, description, inputLength);
065    }
066
067    /**
068     * {@inheritDoc}
069     */
070    @NotNull
071    @Override
072    public ArchetypeAttribute newArchetypeAttributeFacename(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
073        return new TestArchetypeAttribute("face_name", archetypeAttributeName, attributeName, description, inputLength);
074    }
075
076    /**
077     * {@inheritDoc}
078     */
079    @NotNull
080    @Override
081    public ArchetypeAttribute newArchetypeAttributeFixed(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
082        return new TestArchetypeAttribute("fixed", archetypeAttributeName, attributeName, description, inputLength);
083    }
084
085    /**
086     * {@inheritDoc}
087     */
088    @NotNull
089    @Override
090    public ArchetypeAttribute newArchetypeAttributeFloat(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
091        return new TestArchetypeAttribute("float", archetypeAttributeName, attributeName, description, inputLength);
092    }
093
094    /**
095     * {@inheritDoc}
096     */
097    @NotNull
098    @Override
099    public ArchetypeAttribute newArchetypeAttributeInt(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength, final int minValue, final int maxValue, final int minCheckValue, final int maxCheckValue) {
100        return new TestArchetypeAttribute("int", archetypeAttributeName, attributeName, description, inputLength);
101    }
102
103    /**
104     * {@inheritDoc}
105     */
106    @NotNull
107    @Override
108    public ArchetypeAttribute newArchetypeAttributeInvSpell(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
109        return new TestArchetypeAttribute("inv_spell", archetypeAttributeName, attributeName, description, inputLength);
110    }
111
112    /**
113     * {@inheritDoc}
114     */
115    @NotNull
116    @Override
117    public ArchetypeAttribute newArchetypeAttributeInvSpellOptional(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
118        return new TestArchetypeAttribute("inv_spell_optional", archetypeAttributeName, attributeName, description, inputLength);
119    }
120
121    /**
122     * {@inheritDoc}
123     */
124    @NotNull
125    @Override
126    public ArchetypeAttribute newArchetypeAttributeList(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength, @NotNull final String listName) {
127        return new TestArchetypeAttribute("list", archetypeAttributeName, attributeName, description, inputLength);
128    }
129
130    /**
131     * {@inheritDoc}
132     */
133    @NotNull
134    @Override
135    public ArchetypeAttribute newArchetypeAttributeList2(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength, @NotNull final String listName1, @NotNull final String listName2) {
136        return new TestArchetypeAttribute("list2", archetypeAttributeName, attributeName, description, inputLength);
137    }
138
139    /**
140     * {@inheritDoc}
141     */
142    @NotNull
143    @Override
144    public ArchetypeAttribute newArchetypeAttributeLong(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
145        return new TestArchetypeAttribute("long", archetypeAttributeName, attributeName, description, inputLength);
146    }
147
148    /**
149     * {@inheritDoc}
150     */
151    @NotNull
152    @Override
153    public ArchetypeAttribute newArchetypeAttributeMapPath(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
154        return new TestArchetypeAttribute("map_path", archetypeAttributeName, attributeName, description, inputLength);
155    }
156
157    /**
158     * {@inheritDoc}
159     */
160    @NotNull
161    @Override
162    public ArchetypeAttribute newArchetypeAttributeScriptFile(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
163        return new TestArchetypeAttribute("script_file", archetypeAttributeName, attributeName, description, inputLength);
164    }
165
166    /**
167     * {@inheritDoc}
168     */
169    @NotNull
170    @Override
171    public ArchetypeAttribute newArchetypeAttributeSpell(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
172        return new TestArchetypeAttribute("spell", archetypeAttributeName, attributeName, description, inputLength);
173    }
174
175    /**
176     * {@inheritDoc}
177     */
178    @NotNull
179    @Override
180    public ArchetypeAttribute newArchetypeAttributeString(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
181        return new TestArchetypeAttribute("string", archetypeAttributeName, attributeName, description, inputLength);
182    }
183
184    /**
185     * {@inheritDoc}
186     */
187    @NotNull
188    @Override
189    public ArchetypeAttribute newArchetypeAttributeText(@NotNull final String archetypeAttributeName, @NotNull final String endingOld, @NotNull final String attributeName, @NotNull final String description, final int inputLength, @Nullable final String fileExtension) {
190        return new TestArchetypeAttribute("text", archetypeAttributeName, attributeName, description, inputLength);
191    }
192
193    /**
194     * {@inheritDoc}
195     */
196    @NotNull
197    @Override
198    public ArchetypeAttribute newArchetypeAttributeTreasure(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
199        return new TestArchetypeAttribute("treasure", archetypeAttributeName, attributeName, description, inputLength);
200    }
201
202    /**
203     * {@inheritDoc}
204     */
205    @NotNull
206    @Override
207    public ArchetypeAttribute newArchetypeAttributeZSpell(@NotNull final String archetypeAttributeName, @NotNull final String attributeName, @NotNull final String description, final int inputLength) {
208        return new TestArchetypeAttribute("nz_spell", archetypeAttributeName, attributeName, description, inputLength);
209    }
210
211}