|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.newdawn.asd.data.Map
A map in the game including any monsters running around, walls and items.
| Constructor Summary | |
Map(long seed,
GameWorld world)
Create a new map. |
|
| Method Summary | |
void |
addActor(Actor actor)
Add an actor to the game map |
boolean |
blocked(int x,
int y)
Check if a particular location on the map blocks movement |
boolean |
containsActor(Actor actor)
Check whether a particular actor is contained within this map |
Path |
findPath(Actor finder,
int sx,
int sy,
int dx,
int dy,
boolean considerActors)
Find a path from a source square to a destination square |
Actor |
getActorById(int id)
Get an actor based on its unique ID |
ActorList |
getActors()
Get the list of actors currently roaming this map |
int |
getChecksum()
Retrieve the checksum from the content of this map |
int |
getMapHeight()
Get the height of the map in tiles |
int |
getMapWidth()
Get the width of the map in tiles |
int |
getPlayerActorCount()
Get the number of player actors contained in this map |
MapLocation |
getStart(int index)
Get the location at which players should start |
int |
getTileAt(int x,
int y)
Get the index of the tile at the specified location |
int |
getTileAt(int x,
int y,
int layer)
Get the tile at a specified location. |
GameWorld |
getWorld()
Get the world in which the map is held |
boolean |
hasLOS(Actor source,
Actor target)
Check if one actor can "see" another, i.e has line of sight (LOS) |
boolean |
hasLOS(float sx,
float sy,
float ex,
float ey)
Check if a particular location has line of sight (LOS) to the the destination specified |
boolean |
isBlocked(int x,
int y)
Is a particular tile location current blocked |
void |
removeActor(Actor actor)
Remove an actor from the game map |
void |
update(int delta)
Update the map and all the actors contained |
boolean |
validActorPosition(Actor actor,
float x,
float y)
Check if the specified location would be valid (i.e. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Map(long seed,
GameWorld world)
world - The game world in which the map is createdseed - The seed to base the map generation on| Method Detail |
public GameWorld getWorld()
public MapLocation getStart(int index)
index - The index of the start position to get
public void update(int delta)
delta - The amount of simulation time in milliseconds
the actors and map should be moved on.
public int getTileAt(int x,
int y)
x - The x coordinate of the tile to retrievey - The y coordinate of the tile to retrieve
public void addActor(Actor actor)
actor - The actor to addpublic void removeActor(Actor actor)
actor - The actor to removepublic int getPlayerActorCount()
public ActorList getActors()
public Actor getActorById(int id)
id - The ID of the actor to be retrieve
public boolean hasLOS(float sx,
float sy,
float ex,
float ey)
sx - The source x coordinate of the checksy - The source y coordinate of the checkex - The target x coordinate of the checkey - The target y coordinate of the check
public boolean hasLOS(Actor source,
Actor target)
source - The source actor from where the LOS startstarget - The target actor the source is looking at
public boolean blocked(int x,
int y)
x - The x coordinate of the location to checky - The y coordinate of the location to check
public boolean validActorPosition(Actor actor,
float x,
float y)
actor - The actor that could potentially be at the locationx - The x coordinate of the locationy - The y coordinate of the location
public int getChecksum()
public int getTileAt(int x,
int y,
int layer)
TileMap
getTileAt in interface TileMapx - The x position of the tile to retrievey - The y position of the tile to retrievelayer - The layer of the tile to retrieve (zero being the base)
TileMap.getTileAt(int, int, int)public int getMapWidth()
TileMap
getMapWidth in interface TileMapTileMap.getMapWidth()public int getMapHeight()
TileMap
getMapHeight in interface TileMapTileMap.getMapHeight()
public boolean isBlocked(int x,
int y)
TileMap
isBlocked in interface TileMapx - The x coordinate of the tile location to checky - The y coordinate of the tile location to check
TileMap.isBlocked(int, int)
public Path findPath(Actor finder,
int sx,
int sy,
int dx,
int dy,
boolean considerActors)
finder - The actor doing the findingsx - The x-coordinate of the start locationsy - The y-coordinate of the start locationdx - The x-coordinate of the destination locationdy - The y-coordinate of the destination locationconsiderActors - True if we should consider other actors blocking
public boolean containsActor(Actor actor)
actor - The actor to check for
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||