 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.mapmodel;
22 import java.awt.Point;
23 import java.util.Iterator;
31 import org.jetbrains.annotations.NotNull;
32 import org.junit.Assert;
33 import org.junit.Before;
34 import org.junit.Test;
120 final Iterator<TestGameObject>
it = mapSquare.
iterator();
121 Assert.assertTrue(
it.hasNext());
122 Assert.assertEquals(
"1",
it.next().getBestName());
123 Assert.assertTrue(
it.hasNext());
124 Assert.assertEquals(
"4",
it.next().getBestName());
125 Assert.assertTrue(
it.hasNext());
126 Assert.assertEquals(
"3",
it.next().getBestName());
127 Assert.assertFalse(
it.hasNext());
145 final Iterator<TestGameObject>
it = mapSquare.
iterator();
146 Assert.assertTrue(
it.hasNext());
147 Assert.assertEquals(
"1",
it.next().getBestName());
148 Assert.assertTrue(
it.hasNext());
149 Assert.assertEquals(
"4",
it.next().getBestName());
150 Assert.assertTrue(
it.hasNext());
151 Assert.assertEquals(
"3",
it.next().getBestName());
152 Assert.assertFalse(
it.hasNext());
An Archetype implementation for testing purposes.
TestArchetype newArchetype(@NotNull final String archetypeName)
Creates a new TestArchetype instance but doesn't add it to the archetype set.
A MapModel reflects the data of a map.
Base package of all Gridarta classes.
void endTransaction()
End a transaction.
TestMapModelCreator mapModelCreator
The TestMapModelCreator instance.
A GameObject implementation for testing purposes.
void beginTransaction(@NotNull String name)
Starts a new transaction.
void testInsertSystemObject1()
Checks that the auto-insertion mode works as expected.
Helper class for regression tests to create MapModel instances.
Interface for classes that match GameObjects.
final GameObjectMatcher belowFloorGameObjectMatcher
A GameObjectMatcher that matches objects to be put below the floor.
final InsertionMode topmostInsertionMode
The topmost-insertion mode.
GameObjects are the objects based on Archetypes found on maps.
final GameObjectMatcher systemGameObjectMatcher
A GameObjectMatcher that matches system objects.
MapModel< TestGameObject, TestMapArchObject, TestArchetype > newMapModel(final int w, final int h)
Creates a new MapModel instance.
An GameObjectMatcher matching certain archetype types.
Iterator< G > iterator()
The Iterator returned does not recurse, it only contains objects on the first level.
void testInsertSystemObject2()
Checks that the auto-insertion mode works as expected.
Classes related to matching {GameObjects}, so called { net.sf.gridarta.model.match....
ArchetypeSet< TestGameObject, TestMapArchObject, TestArchetype > getArchetypeSet()
Returns the ArchetypeSet.
Automatically guess the insertion position.
void setUp()
Initializes the tests.
static final int TYPE_SYSTEM
The archetype type for system objects.
MapSquare< G, A, R > getMapSquare(@NotNull Point pos)
Get the square at a specified location.
static final int TYPE_BELOW_FLOOR
The archetype type for objects to be put below the floor.
final GameObjectMatcher wallGameObjectMatcher
A GameObjectMatcher that matches wall objects.
Regression tests for AutoInsertionMode.
void addGameObjectToMap(@NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype > mapModel, @NotNull final String archetypeName, @NotNull final String name, final int x, final int y, @NotNull final InsertionMode insertionMode)
Inserts a game object into a map.
An Exception indicating that an Archetype name is not unique.
A MapArchObject implementation for testing purposes.
final GameObjectMatcher floorGameObjectMatcher
A GameObjectMatcher that matches floor objects.
String TYPE
The attribute name of the object's type.
static final int TYPE_WALL
The archetype type for wall objects.
static final int TYPE_FLOOR
The archetype type for floor objects.
final InsertionMode autoInsertionMode
The auto-insertion mode.
This document describes some hints and requirements for general development on the CrossfireEditor If you plan to make changes to the editor code or setup please read the following and keep it in derived from a basic editor application called Gridder by Pasi Ker�nen so please communicate with best through the cf devel mailing before considering any fundamental changes About code DO NOT USE TABS No matter what Java development platform you are please configure insert indent Tabs are displayed totally different in every editor and there are millions of different editors out there The insertion of tabs in the source code is messing up the syntax formatting in a way that is UNREPAIRABLE Apart from please keep code indentation accurate This is not just good it helps to keep code readable and in that way dramatically decreases the chance for overlooked bugs Everyone is welcomed to correct indentation errors wherever they are spotted Before you start to do this please double check that your editor is really configured to insert spaces Line feeds may be checked in either in windows or in unix linux style All reasonable text and java editors can deal with both linefeed formats Converting line feeds is but in this case please make sure that only linefeed characters are changed and nothing else is affected Due to the platform independent nature of the editor has the potential to run on almost any given operating system the build process differs greatly between systems as well as java environments In the several people have attempted to add build scripts along with structural changes to optimize the setup on one particular system environment which has led to conflict Please do *not *attempt to change the structure or any directories for the mere purpose of improving a build process or performance in a java environment Build scripts may be placed in the root it would be especially fine if it is just one or two files but the latter is not required Please excuse me for placing such restriction I and many users of the editor greatly appreciate build scripts We just had some real troubles over this issue in the past and I don t want to have them repeated the editor has relatively high performance requirements I ve spent a lot of extra work to keep everything as fast and memory efficient as possible when you add new data fields or calculations in the archetype please make sure they are as efficient as possible and worth both the time and space they consume Now don t be afraid too much No development would be possible without adding calculations and data at all Just bear in mind unlike for many other open source performance does make a difference for the CrossfireEditor The for as many systems as possible In case you are unexperienced with java and note that the graphics look different on every and with every font They also have different sizes proportions and behave different A seemingly trivial and effectless change can wreck havoc for the same GUI run on another system please don t be totally afraid of it