Gridarta Editor
ValidationUtils.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2015 The Gridarta Developers.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 package net.sf.gridarta.model.validation;
21 
37 import org.jetbrains.annotations.NotNull;
38 
43 public class ValidationUtils {
44 
48  private ValidationUtils() {
49  }
50 
55  @NotNull
57  final ValidatorPreferences validatorPreferences = new TestValidatorPreferences();
58  final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false);
59  final GameObjectMatchers gameObjectMatchers = mapModelCreator.getGameObjectMatchers();
60  gameObjectMatchers.addGameObjectMatcher(new NamedGameObjectMatcher(0, "matcher", "name", false, null, new TypeNrsGameObjectMatcher(1)));
63  final MapWriter<TestGameObject, TestMapArchObject, TestArchetype> mapWriter = new DefaultMapWriter<>(mapArchObjectParserFactory, gameObjectParser);
64  final ProjectSettings projectSettings = new TestProjectSettings();
65  return new ValidatorFactory<>(validatorPreferences, gameObjectMatchers, projectSettings, mapWriter);
66  }
67 
68 }
Default implementation of MapWriter.
Utility class for helper functions needed be regression tests.
Reading and writing of maps, handling of paths.
This package contains classes related to matching GameObjects, so called GameObjectMatchers.
Helper class for regression tests to create MapModel instances.
Settings that apply to a project.
Interface for classes that write map files.
Definition: MapWriter.java:34
This package contains the framework for validating maps.
ValidatorPreferences implementation for regression tests.
Interface for classes that read or write GameObject instances.
static ValidatorFactory< TestGameObject, TestMapArchObject, TestArchetype > newValidatorFactory()
Creates a new ValidatorFactory instance.
Decorates an arbitrary GameObjectMatcher with a localized name that is suitable for the user interfac...
A MapArchObject implementation for testing purposes.
Factory for creating MapArchObjectParser instances.
void addGameObjectMatcher(@NotNull final NamedGameObjectMatcher gameObjectMatcher)
Adds a new GameObjectMatcher.
Base package of all Gridarta classes.
ValidationUtils()
Private constructor to prevent instantiation.
GameObjects are the objects based on Archetypes found on maps.
Maintains GameObjectMatcher instances.
GameObjectParser< TestGameObject, TestMapArchObject, TestArchetype > newGameObjectParser()
Creates a new GameObjectParser instance.
A factory for creating Validator instances from string representation.
An Archetype implementation for testing purposes.
An GameObjectMatcher matching certain archetype types.
A GameObject implementation for testing purposes.
This package contains the checks for validating maps.
An ProjectSettings implementation for testing purposes.
GameObjectMatchers getGameObjectMatchers()
Returns the GameObjectMatchers instance.
A MapArchObjectParserFactory for regression tests.