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.util.LinkedHashMap; 023import java.util.Map; 024import net.sf.gridarta.model.archetype.TestArchetype; 025import net.sf.gridarta.model.archetypeset.ArchetypeSet; 026import net.sf.gridarta.model.gameobject.GameObjectFactory; 027import net.sf.gridarta.model.gameobject.TestGameObject; 028import net.sf.gridarta.model.maparchobject.TestMapArchObject; 029import org.jetbrains.annotations.NotNull; 030 031/** 032 * A {@link GameObjectParser} for regression tests. 033 * @author Andreas Kirschbaum 034 */ 035public class TestGameObjectParser extends AbstractGameObjectParser<TestGameObject, TestMapArchObject, TestArchetype> { 036 037 /** 038 * Create a new instance. 039 * @param gameObjectFactory the game object factory for creating new game 040 * object instances 041 * @param archetypeSet the archetype set for looking up archetypes 042 */ 043 public TestGameObjectParser(@NotNull final GameObjectFactory<TestGameObject, TestMapArchObject, TestArchetype> gameObjectFactory, @NotNull final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet) { 044 super(gameObjectFactory, archetypeSet); 045 } 046 047 /** 048 * {@inheritDoc} 049 */ 050 @NotNull 051 @Override 052 public Map<String, String> getModifiedFields(@NotNull final TestGameObject gameObject) { 053 final Map<String, String> fields = new LinkedHashMap<String, String>(); 054 addModifiedFields(gameObject, fields); 055 return fields; 056 } 057 058}