 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.io;
22 import java.awt.Point;
23 import java.io.IOException;
24 import java.io.Writer;
30 import org.jetbrains.annotations.NotNull;
63 final A mapArch = mapModel.getMapArchObject();
68 final Size2D mapSize = mapArch.getMapSize();
69 final int width = mapSize.
getWidth();
71 final Point pos =
new Point();
72 for (pos.x = 0; pos.x < width; pos.x++) {
73 for (pos.y = 0; pos.y < height; pos.y++) {
74 for (
final G gameObject : mapModel.getMapSquare(pos)) {
75 if (gameObject.isHead()) {
int getWidth()
Returns the width of the area.
A MapModel reflects the data of a map.
void save(@NotNull Appendable appendable, @NotNull G gameObject)
Write a game object object to a stream.
Base package of all Gridarta classes.
final GameObjectParser< G, A, R > gameObjectParser
The GameObjectParser to use.
void save(@NotNull Appendable appendable, @NotNull A mapArchObject, @Nullable MapFile mapFile)
Write a map arch object to a stream.
final MapArchObjectParserFactory< A > mapArchObjectParserFactory
The MapArchObjectParserFactory to use.
Reflects a game object (object on a map).
DefaultMapWriter(@NotNull final MapArchObjectParserFactory< A > mapArchObjectParserFactory, @NotNull final GameObjectParser< G, A, R > gameObjectParser)
Creates a new instance.
void encodeMapFile(@NotNull final MapModel< G, A, R > mapModel, @NotNull final Writer writer)
GameObjects are the objects based on Archetypes found on maps.
MapArchObjectParser< A > newMapArchObjectParser()
Creates a new MapArchObjectParser instance.
int getHeight()
Returns the height of the area.
Interface for classes that write map files.
Interface for MapArchObjects.
Default implementation of MapWriter.
The class Size2D represents a 2d rectangular area.