us.asciiroth.client.board
Class BoardWriter

java.lang.Object
  extended by us.asciiroth.client.board.WriterBase
      extended by us.asciiroth.client.board.BoardWriter

public class BoardWriter
extends WriterBase

Start with this storing in memory as a JSON data structure.


Field Summary
static java.lang.String CREATOR
          If this is the start board, it can encode the creator of the scenario.
static java.lang.String DESCRIPTION
          If this is the start board, it can encode a description of the scenario.
static java.lang.String DIAGRAM_KEY
          The property specifying a diagram described using arbitrarily chosen symbols for each cell of the board.
static java.lang.String KEY_KEY
          For a given piece, the String key that describes the piece (essentially its serialization for the board JSON).
static java.lang.String MUSIC
          Not currently implemented, but there is a property to specify an mp3 file in case music is added later.
static java.lang.String OUTSIDE_MAP
          The property specifying whether the map represents an outside or inside area (the player and other pieces may be drawn differently as a result).
static java.lang.String PIECES_KEY
          An array of JSON objects that describe the pieces and their location on the board.
static java.lang.String SCENARIO_NAME
          If this is the start board, it can encode the name of the scenario for the load feature.
static java.lang.String START_INVENTORY
          For testing purposes, if the player starts on this map rather than entering from another map, the player can be assigned a starting inventory.
static java.lang.String START_X_KEY
          If provided, and the player does not enter from another map, this is the starting X position of the player on the board.
static java.lang.String START_Y_KEY
          If provided, and the player does not enter from another map, this is the starting Y position of the player on the board.
static java.lang.String TERRAIN_KEY
          A property specifying a mapping between the symbols in the diagram and the terrain they represent.
static java.lang.String X_KEY
          For a given piece, its X coordinate on the board.
static java.lang.String Y_KEY
          For a given piece, its Y coordinate on the board.
 
Constructor Summary
BoardWriter()
           
 
Method Summary
 java.lang.String write(Board board, boolean preserveMetadata)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATOR

public static final java.lang.String CREATOR
If this is the start board, it can encode the creator of the scenario.

See Also:
Constant Field Values

DESCRIPTION

public static final java.lang.String DESCRIPTION
If this is the start board, it can encode a description of the scenario.

See Also:
Constant Field Values

DIAGRAM_KEY

public static final java.lang.String DIAGRAM_KEY
The property specifying a diagram described using arbitrarily chosen symbols for each cell of the board. Their meaning is described by the DIAGRAM_KEY portion of the map.

See Also:
Constant Field Values

KEY_KEY

public static final java.lang.String KEY_KEY
For a given piece, the String key that describes the piece (essentially its serialization for the board JSON).

See Also:
Constant Field Values

MUSIC

public static final java.lang.String MUSIC
Not currently implemented, but there is a property to specify an mp3 file in case music is added later.

See Also:
Constant Field Values

OUTSIDE_MAP

public static final java.lang.String OUTSIDE_MAP
The property specifying whether the map represents an outside or inside area (the player and other pieces may be drawn differently as a result).

See Also:
Constant Field Values

PIECES_KEY

public static final java.lang.String PIECES_KEY
An array of JSON objects that describe the pieces and their location on the board.

See Also:
Constant Field Values

SCENARIO_NAME

public static final java.lang.String SCENARIO_NAME
If this is the start board, it can encode the name of the scenario for the load feature.

See Also:
Constant Field Values

START_INVENTORY

public static final java.lang.String START_INVENTORY
For testing purposes, if the player starts on this map rather than entering from another map, the player can be assigned a starting inventory. Comma-separated list of items.

See Also:
Constant Field Values

START_X_KEY

public static final java.lang.String START_X_KEY
If provided, and the player does not enter from another map, this is the starting X position of the player on the board.

See Also:
Constant Field Values

START_Y_KEY

public static final java.lang.String START_Y_KEY
If provided, and the player does not enter from another map, this is the starting Y position of the player on the board.

See Also:
Constant Field Values

TERRAIN_KEY

public static final java.lang.String TERRAIN_KEY
A property specifying a mapping between the symbols in the diagram and the terrain they represent. The value of each element in this JSON object are either String keys representing an individual Terrain piece, or an array of pieces, starting with a terrain piece but capable of including items and an agent as well. The latter is useful because it allows the diagram to indicate where items and agents should be placed, rather than having to specify their x/y coordinates separately.

See Also:
Constant Field Values

X_KEY

public static final java.lang.String X_KEY
For a given piece, its X coordinate on the board.

See Also:
Constant Field Values

Y_KEY

public static final java.lang.String Y_KEY
For a given piece, its Y coordinate on the board.

See Also:
Constant Field Values
Constructor Detail

BoardWriter

public BoardWriter()
Method Detail

write

public java.lang.String write(Board board,
                              boolean preserveMetadata)

0.7

2009 Alx Dark