Class MapLevelBuilder
java.lang.Object
fr.r1r0r0.deltaengine.model.maplevel.MapLevelBuilder
public final class MapLevelBuilder extends java.lang.Object implements Builder<MapLevel>
A Builder of MapLevel
- See Also:
MapLevel
,Builder
,CellBuilder
-
Field Summary
Fields Modifier and Type Field Description private Cell[][]
cells
private CellBuilder
defaultCellBuilder
private int
height
private java.lang.String
name
private static CellBuilder
VOID_CELL_BUILDER
A CellBuilder of VoidCellprivate int
width
-
Constructor Summary
Constructors Constructor Description MapLevelBuilder(java.lang.String name, int width, int height)
Constructor The attribute defaultCellBuilder is set to VOID_CELL_BUILDERMapLevelBuilder(java.lang.String name, int width, int height, CellBuilder defaultCellBuilder)
Constructor -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
VOID_CELL_BUILDER
A CellBuilder of VoidCell -
name
private final java.lang.String name -
width
private final int width -
height
private final int height -
cells
-
defaultCellBuilder
-
-
Constructor Details
-
MapLevelBuilder
public MapLevelBuilder(java.lang.String name, int width, int height, CellBuilder defaultCellBuilder)Constructor- Parameters:
name
- name of the mapwidth
- with of the mapheight
- height of the mapdefaultCellBuilder
- defaultCellBuilder for the cell not difined in the map
-
MapLevelBuilder
public MapLevelBuilder(java.lang.String name, int width, int height)Constructor The attribute defaultCellBuilder is set to VOID_CELL_BUILDER- Parameters:
name
- name of the mapwidth
- with of the mapheight
- height of the map
-
-
Method Details
-
setCell
Setter for the cell at the coordinate given by the cell coordinates- Parameters:
cell
- a cell- Returns:
- the current object
- Throws:
MapLevelBuilderCellCoordinatesStackingException
- throw of the cell given replace an other cell with the same coordinates
-
build
Description copied from interface:Builder
A method to build an object of type E -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-