|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.map.GameMap
public abstract class GameMap
Nested Class Summary | |
---|---|
static class |
GameMap.QUEUE
|
Field Summary | |
---|---|
protected Background |
background
|
protected CollisionMap |
collisionMap
|
protected java.util.List<GComponent> |
components
|
protected Layout |
layout
|
protected MapRenderer |
mapRenderer
|
protected MapSize |
mapSize
|
protected java.util.Collection<Updateable> |
updateables
|
Constructor Summary | |
---|---|
GameMap()
|
Method Summary | |
---|---|
void |
addComponents(GComponent gComponent)
add a GameComponent to the map, which will be displayed on top of everything else. |
abstract void |
addSection(Section section,
GameLocation gameLocation)
Add a Section to the specified location. |
abstract void |
addSprite(Sprite sprite,
GameLocation gameLocation)
Add a sprite to the specified location. |
abstract Sprite |
addSpriteCopy(Sprite sprite,
GameLocation gameLocation)
Add a copy of the sprite to the specified location. |
abstract Decor |
addTile(Decor decor,
GameLocation gameLocation)
Add a Tile to the specified location. |
abstract Decor |
addTile(Decor decor,
GameLocation gameLocation,
boolean placeHolder,
boolean nonTileCollision)
Add a Tile to the specified location. |
void |
addUpdateable(Updateable updateable)
Used for adding additional elements that are updateable. |
void |
clearQueueComponents()
|
void |
draw(java.awt.Graphics2D graphics)
Draws the GameMap, usually by using a MapRenderer. |
Actions |
getActions()
|
Background |
getBackground()
|
GComponent |
getComponentByName(java.lang.String name)
Returns a component in the map by its name. |
java.util.Collection<GComponent> |
getComponents()
Returns the list of all GameComponents. |
Layout |
getLayout()
|
MapSize |
getMapSize()
|
java.lang.String |
getName()
|
abstract Actor |
getPlayer()
Gets the player Sprite. |
abstract java.util.Collection<Sprite> |
getSprites()
Returns the list of all moving sprites. |
abstract MapElement |
getTile(int x,
int y,
int z)
Returns the MapElement at the map grid location. |
boolean |
removeComponent(GComponent component)
Removes the specified GComponent from the map. |
abstract boolean |
removeSprite(Sprite sprite)
|
abstract Decor |
removeTile(GameLocation gameLocation)
|
void |
setBackground(Background background)
|
abstract void |
setCollisionMap(CollisionMap collisionMap)
|
void |
setLayout(Layout layout)
|
void |
setMapRenderer(MapRenderer mapRenderer)
|
void |
setMapSize(MapSize mapSize)
|
void |
setName(java.lang.String name)
|
abstract void |
setPlayer(Actor player,
GameLocation gameLocation)
Sets the player Sprite. |
void |
setScreenSize(int width,
int height)
Set the size of the screen. |
protected void |
setupPlayer(Actor player)
If player is a KeyPollListener, add the |
void |
update(long elapseTime)
Update the elements in the GameMap. |
void |
updateQueueComponent(GComponent gComponent,
GameMap.QUEUE queue)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Background background
protected MapSize mapSize
protected java.util.Collection<Updateable> updateables
protected CollisionMap collisionMap
protected java.util.List<GComponent> components
protected Layout layout
protected MapRenderer mapRenderer
Constructor Detail |
---|
public GameMap()
Method Detail |
---|
public void addComponents(GComponent gComponent)
gComponent
- public abstract void addSection(Section section, GameLocation gameLocation)
section
- SectiongameLocation
- GameLocationpublic abstract void addSprite(Sprite sprite, GameLocation gameLocation)
sprite
- SpritegameLocation
- GameLocationpublic abstract Sprite addSpriteCopy(Sprite sprite, GameLocation gameLocation)
sprite
- SpritegameLocation
- GameLocation
public abstract Decor addTile(Decor decor, GameLocation gameLocation)
decor
- DecorgameLocation
- GameLocation
public abstract Decor addTile(Decor decor, GameLocation gameLocation, boolean placeHolder, boolean nonTileCollision)
decor
- gameLocation
- placeHolder
- nonTileCollision
-
public void addUpdateable(Updateable updateable)
updateable
- Updateablepublic void clearQueueComponents()
public void draw(java.awt.Graphics2D graphics)
graphics
- Graphics2Dpublic Actions getActions()
public Background getBackground()
public java.util.Collection<GComponent> getComponents()
public GComponent getComponentByName(java.lang.String name)
name
-
public Layout getLayout()
public MapSize getMapSize()
public java.lang.String getName()
getName
in interface Updateable
public abstract Actor getPlayer()
public abstract java.util.Collection<Sprite> getSprites()
public abstract MapElement getTile(int x, int y, int z)
x
- inty
- intz
- int
public boolean removeComponent(GComponent component)
component
-
public abstract boolean removeSprite(Sprite sprite)
sprite
-
public abstract Decor removeTile(GameLocation gameLocation)
gameLocation
-
public void setBackground(Background background)
background
- public abstract void setCollisionMap(CollisionMap collisionMap)
collisionMap
- CollisionMappublic void setLayout(Layout layout)
layout
- public void setMapRenderer(MapRenderer mapRenderer)
mapRenderer
- MapRendererpublic void setMapSize(MapSize mapSize)
mapSize
- MapSizepublic void setName(java.lang.String name)
name
- Stringpublic abstract void setPlayer(Actor player, GameLocation gameLocation)
player
- ActorgameLocation
- GameLocationpublic void setScreenSize(int width, int height)
width
- intheight
- intpublic void update(long elapseTime)
update
in interface Updateable
elapseTime
- longpublic void updateQueueComponent(GComponent gComponent, GameMap.QUEUE queue)
protected void setupPlayer(Actor player)
player
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |