jurpe.dungeon
Class Level

java.lang.Object
  extended by jurpe.dungeon.Level
All Implemented Interfaces:
java.io.Serializable

public class Level
extends java.lang.Object
implements java.io.Serializable

Level contain objects found on a dungeon level, and it is composed by:

See Also:
jurpe.dungeon.rpgmap.RpgMap;, Serialized Form

Constructor Summary
Level(RpgMap sMap, int sLevel)
          Dungeon Level
 
Method Summary
 void addAvatar(Avatar av)
           
 void fillWithItems(Dungeons dungeon)
          Fill this level with random items
 void fillWithMonsters(Dungeons dungeon)
          Fill this level with random monsters
 Avatar getAvatar()
           
 Lootables getItems()
          Return the random items in this level
 java.lang.String getLevelFileName()
          Get the name that the file with this map will have.
static java.lang.String getLevelFileName(int level)
          The name that the file with the level map will have
 java.lang.String getLevelName()
          Name of the level (ie> Underground_02)
static java.lang.String getLevelName(int level)
          Get the name for this level
 Monsters getMonsters()
          Monsters object collection
 PlaceHolder getPlaceHolderIn(RpgMapPoint rpgPoint)
          Get placeholder in this level rpgmappoint
 RpgMap getRpgMap()
          Get RpgMap of this level
 int getZ()
          Get the level.
 boolean isTherePlaceHolder(RpgMapPoint p)
          Return true if there is a placeholder in this rpgmappoint
 java.util.AbstractList<PlaceHolder> placeHolders()
          The placeholders in this map
 void removeAvatar()
           
 boolean save()
          Persist this level
 java.lang.String toString()
          Return the name of this map
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Level

public Level(RpgMap sMap,
             int sLevel)
Dungeon Level

Parameters:
sMap - RpgMap associated to this level
sLevel - Dungeon level
Method Detail

fillWithMonsters

public void fillWithMonsters(Dungeons dungeon)
Fill this level with random monsters

Parameters:
dungeon - Dungeons handle

fillWithItems

public void fillWithItems(Dungeons dungeon)
Fill this level with random items

Parameters:
dungeon - Dungeons handle

addAvatar

public void addAvatar(Avatar av)
Parameters:
av - Avatar

removeAvatar

public void removeAvatar()

getItems

public Lootables getItems()
Return the random items in this level

Returns:
Random items in this level

getAvatar

public Avatar getAvatar()
Returns:
Avatar

getMonsters

public Monsters getMonsters()
Monsters object collection

Returns:
Monsters Monsters object collection

placeHolders

public java.util.AbstractList<PlaceHolder> placeHolders()
The placeholders in this map

Returns:
AbstractList A placeholders list

getPlaceHolderIn

public PlaceHolder getPlaceHolderIn(RpgMapPoint rpgPoint)
Get placeholder in this level rpgmappoint

Parameters:
rpgPoint - RpgMapPoint
Returns:
PlaceHolder Placeholder in this level

isTherePlaceHolder

public boolean isTherePlaceHolder(RpgMapPoint p)
Return true if there is a placeholder in this rpgmappoint

Parameters:
p - RpgMapPoint
Returns:
boolean

getZ

public int getZ()
Get the level. The more this number is high, the more difficult the level should be.

Returns:
The level of the dungeon.

getRpgMap

public RpgMap getRpgMap()
Get RpgMap of this level

Returns:
RpgMap of this level
See Also:
jurpe.dungeon.rpgmap.RpgMap;

save

public boolean save()
Persist this level

Returns:
true if the save was successful

getLevelName

public java.lang.String getLevelName()
Name of the level (ie> Underground_02)

Returns:
The name of this level

getLevelName

public static java.lang.String getLevelName(int level)
Get the name for this level

Parameters:
level - Level id
Returns:
String name for this level

toString

public java.lang.String toString()
Return the name of this map

Overrides:
toString in class java.lang.Object
Returns:
Name of this map

getLevelFileName

public java.lang.String getLevelFileName()
Get the name that the file with this map will have.

Returns:
String Name of the file (without path) to which this map will be saved

getLevelFileName

public static java.lang.String getLevelFileName(int level)
The name that the file with the level map will have

Parameters:
level - Level number of the map
Returns:
Name of the level file (without path)

Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net