|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.dbarnes.sgme.Map
public class Map
Represents a map in a project. A map contains a two-dimensional array of tile IDs, as well as a list of MapWidget objects. Maps also can have a background color, which is defined by a single RGB value.
| Field Summary | |
|---|---|
static int |
MAX_HEIGHT
|
static int |
MAX_WIDTH
|
| Constructor Summary | |
|---|---|
Map()
Creates a new Map object. |
|
| Method Summary | |
|---|---|
MapWidget |
addMapWidget(int x,
int y,
Widget widget)
Adds a MapWidget at the specified coordinates. |
void |
deleteColumn(int deleteAtX)
Deletes a column of tiles at the specified column index, and shifts all columns to the right of that index to the left by one column. |
boolean |
deleteMapWidget(MapWidget mapWidget)
Removes the specified MapWidget object from the map. |
void |
deleteMapWidgets(int x,
int y)
Removes all MapWidgets for the specified coordinates. |
void |
deleteMapWidgets(Widget widget)
Removes all MapWidgets for the specified Widget. |
void |
deleteRow(int deleteAtY)
Deletes a row of tiles at the specified row index, and shifts all rows below that index up by one row. |
int |
getBackgroundColor()
|
int |
getHeight()
Returns the height of the map. |
int |
getId()
Returns the identifier for this Map. |
int |
getMapWidgetCount()
Returns the number of map widgets. |
java.util.Iterator<MapWidget> |
getMapWidgets()
Returns an iterator containing all the MapWidget objects for this Map. |
java.util.Iterator<MapWidget> |
getMapWidgets(int x,
int y)
Returns an Iterator containing the MapWidget objects at the specified coordinates. |
java.util.Iterator<MapWidget> |
getMapWidgets(Widget widget)
Returns an Iterator containing the MapWidget objects for the specified Widget. |
Tile |
getTile(int x,
int y)
Returns the Tile object at the specified x and y coordinates. |
int |
getWidth()
Returns the width of the map. |
void |
insertColumn(int insertAtX)
Inserts a column of blank tiles at the specified column index. |
void |
insertRow(int insertAtY)
Inserts a row of blank tiles at the specified row index. |
void |
setBackgroundColor(int backgroundColor)
|
void |
setHeight(int height)
Sets the height of the map. |
void |
setId(int id)
Sets the identifier for this Map. |
void |
setTile(int x,
int y,
Tile tile)
Sets the Tile object at the specified x and y coordinates. |
void |
setWidth(int width)
Sets the width of the map. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_WIDTH
public static final int MAX_HEIGHT
| Constructor Detail |
|---|
public Map()
| Method Detail |
|---|
public void insertColumn(int insertAtX)
public void deleteColumn(int deleteAtX)
public void insertRow(int insertAtY)
public void deleteRow(int deleteAtY)
public Tile getTile(int x,
int y)
public void setTile(int x,
int y,
Tile tile)
public int getWidth()
public void setWidth(int width)
public int getHeight()
public void setHeight(int height)
public int getId()
public void setId(int id)
public java.util.Iterator<MapWidget> getMapWidgets()
public int getMapWidgetCount()
public java.util.Iterator<MapWidget> getMapWidgets(int x,
int y)
x - the x coordinate of the MapWidget objects to return.y - the y coordinate of the MapWidget objects to return.
public java.util.Iterator<MapWidget> getMapWidgets(Widget widget)
widget - the widget of the MapWidget objects to return.
public MapWidget addMapWidget(int x,
int y,
Widget widget)
public boolean deleteMapWidget(MapWidget mapWidget)
mapWidget - the MapWidget object to remove.
public void deleteMapWidgets(Widget widget)
widget - the Widget of the MapWidget objects to remove.
public void deleteMapWidgets(int x,
int y)
x - the x coordinate of the MapWidget objects to remove.y - the y coordinate of the MapWidget objects to remove.public int getBackgroundColor()
public void setBackgroundColor(int backgroundColor)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||