 |
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;
27 import org.jetbrains.annotations.NotNull;
28 import org.junit.Assert;
29 import org.junit.Test;
45 Assert.assertFalse(
it.hasNext());
56 Assert.assertFalse(
it.hasNext());
66 Assert.assertTrue(
it.hasNext());
67 Assert.assertEquals(
"n4",
it.next().getBestName());
68 Assert.assertTrue(
it.hasNext());
69 Assert.assertEquals(
"n5",
it.next().getBestName());
70 Assert.assertTrue(
it.hasNext());
71 Assert.assertEquals(
"n1",
it.next().getBestName());
72 Assert.assertTrue(
it.hasNext());
73 Assert.assertEquals(
"n2",
it.next().getBestName());
74 Assert.assertTrue(
it.hasNext());
75 Assert.assertEquals(
"n3",
it.next().getBestName());
76 Assert.assertFalse(
it.hasNext());
86 Assert.assertTrue(
it.hasNext());
87 Assert.assertEquals(
"n4",
it.next().getBestName());
88 Assert.assertTrue(
it.hasNext());
89 Assert.assertEquals(
"n3",
it.next().getBestName());
90 Assert.assertTrue(
it.hasNext());
91 Assert.assertEquals(
"n1",
it.next().getBestName());
92 Assert.assertTrue(
it.hasNext());
93 Assert.assertEquals(
"n2",
it.next().getBestName());
94 Assert.assertTrue(
it.hasNext());
95 Assert.assertEquals(
"n5",
it.next().getBestName());
96 Assert.assertFalse(
it.hasNext());
106 Assert.assertTrue(
it.hasNext());
107 Assert.assertEquals(
"n5",
it.next().getBestName());
108 Assert.assertTrue(
it.hasNext());
109 Assert.assertEquals(
"n1",
it.next().getBestName());
110 Assert.assertTrue(
it.hasNext());
111 Assert.assertEquals(
"n2",
it.next().getBestName());
112 Assert.assertTrue(
it.hasNext());
113 Assert.assertEquals(
"n3",
it.next().getBestName());
114 Assert.assertTrue(
it.hasNext());
115 Assert.assertEquals(
"n4",
it.next().getBestName());
116 Assert.assertFalse(
it.hasNext());
126 Assert.assertTrue(
it.hasNext());
127 Assert.assertEquals(
"n3",
it.next().getBestName());
128 Assert.assertTrue(
it.hasNext());
129 Assert.assertEquals(
"n1",
it.next().getBestName());
130 Assert.assertTrue(
it.hasNext());
131 Assert.assertEquals(
"n2",
it.next().getBestName());
132 Assert.assertTrue(
it.hasNext());
133 Assert.assertEquals(
"n5",
it.next().getBestName());
134 Assert.assertTrue(
it.hasNext());
135 Assert.assertEquals(
"n4",
it.next().getBestName());
136 Assert.assertFalse(
it.hasNext());
An Archetype implementation for testing purposes.
A MapModel reflects the data of a map.
void testIteratorBackwardSkip()
Checks the backward iterator with skipped first element.
void testIteratorForward()
Checks the forward iterator.
void testIteratorBackwardEmpty()
Checks the backward iterator on an empty map.
Base package of all Gridarta classes.
void testIteratorBackward()
Checks the backward iterator.
A GameObject implementation for testing purposes.
Iterator for iterating over top-level game object of a map model.
void insertGameObject(@NotNull final GameObject< TestGameObject, TestMapArchObject, TestArchetype > gameObject, @NotNull final String archetypeName, @NotNull final String name)
Inserts a game object into the inventory of another game object.
Helper class for regression tests to create MapModel instances.
GameObjects are the objects based on Archetypes found on maps.
MapModel< TestGameObject, TestMapArchObject, TestArchetype > newMapModel(final int w, final int h)
Creates a new MapModel instance.
void testIteratorForwardSkip()
Checks the forward iterator with skipped first element.
static MapModel< TestGameObject, TestMapArchObject, TestArchetype > createMap()
Creates a new MapModel instance filled with game objects.
MapSquare< G, A, R > getMapSquare(@NotNull Point pos)
Get the square at a specified location.
InsertionMode getTopmostInsertionMode()
Returns the "topmost" insertion mode.
void testIteratorForwardEmpty()
Checks the forward iterator on an empty map.
Regression tests for TopLevelGameObjectIterator.
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.
A MapArchObject implementation for testing purposes.
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