jurpe.dungeon
Class Dungeons

java.lang.Object
  extended by jurpe.dungeon.Dungeons

public class Dungeons
extends java.lang.Object

Dungeons is a representation of a multi-level Dungeon made by maps of hexagonal cells. The class holds references with other system objects.

See Also:
RpgMap, Avatar, IDungeonGenerator

Constructor Summary
Dungeons(Core system)
          Constructor
 
Method Summary
 void addAvatarToCurrentMap()
          Add Avatar placeholder to current map
 void drawDungeon(Level dungeonLevel, HexMap hexMapControl)
          Draw dungeon into and HexMap control and connect its logic.
 Avatar getAvatar()
          Handle to Avatar
 Level getCurrentLevel()
          The level where avatar is
 RpgMap getCurrentMap()
          Get current map
 int getCurrentMapLevel()
          The current map level is where avatar is
 Level getDungeonLevel(int level)
          Handle to Dungeon level
 DungeonLevels getDungeonLevels()
          Return dungeon levels container
 Log getLog()
          Handle to Log
 java.util.Random getRandomSeed()
          Get random seed
 Core getSystem()
          Get core handle
 void initAvatar(HexMap hexMapControl)
          Set a new Avatar.
 void initializeLevels()
          Initialize dungeon levels
 void reset()
          Reset dungeon (when restarting a new game)
 void setCurrentLevel(Level level)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dungeons

public Dungeons(Core system)
Constructor

Parameters:
system - Handle to core system.
Method Detail

initializeLevels

public void initializeLevels()
Initialize dungeon levels


getRandomSeed

public java.util.Random getRandomSeed()
Get random seed

Returns:
Get random seed

getDungeonLevel

public Level getDungeonLevel(int level)
                      throws JurpeException
Handle to Dungeon level

Parameters:
level - Level of dungeon
Returns:
Level of dungeon level
Throws:
JurpeException

getDungeonLevels

public DungeonLevels getDungeonLevels()
Return dungeon levels container

Returns:
DungeonLevels

getCurrentLevel

public Level getCurrentLevel()
                      throws JurpeException
The level where avatar is

Returns:
Level
Throws:
JurpeException

setCurrentLevel

public void setCurrentLevel(Level level)
                     throws JurpeException
Parameters:
level - int
Throws:
JurpeException

getCurrentMap

public RpgMap getCurrentMap()
                     throws JurpeException
Get current map

Returns:
RpgMap Current map. Returns null if avatar is not created.
Throws:
JurpeException

getCurrentMapLevel

public int getCurrentMapLevel()
The current map level is where avatar is

Returns:
Avatar's level

getAvatar

public Avatar getAvatar()
Handle to Avatar

Returns:
Avatar

getLog

public Log getLog()
Handle to Log

Returns:
Log handle

initAvatar

public void initAvatar(HexMap hexMapControl)
                throws JurpeException
Set a new Avatar. If an Avatar exists, restore his position. Else create a new Avatar and set initial position

Parameters:
hexMapControl - HexMap HexMap control
Throws:
JurpeException

addAvatarToCurrentMap

public void addAvatarToCurrentMap()
                           throws JurpeException
Add Avatar placeholder to current map

Throws:
JurpeException

drawDungeon

public void drawDungeon(Level dungeonLevel,
                        HexMap hexMapControl)
                 throws JurpeException
Draw dungeon into and HexMap control and connect its logic.

Parameters:
dungeonLevel - Underground level of dungeon
hexMapControl - HexMap
Throws:
JurpeException

getSystem

public Core getSystem()
Get core handle

Returns:
Core

reset

public void reset()
Reset dungeon (when restarting a new game)


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