be.saltwater.jaqel.level
Class Level

java.lang.Object
  extended bybe.saltwater.jaqel.level.Level

public class Level
extends java.lang.Object

Created to contain CreatureSharedData when a game/session has ended and everything is destroyed. An identity is saved to a file by the user as a "user profile", which also contains the last game level he has completed.

Author:
Robin Wittevrongel, Bruno Windels
See Also:
CreatureSharedData

Field Summary
static int MAGIC_ATTACK_RANGE
           
static int MONSTER_RANGE
           
 
Constructor Summary
Level(Maze maze, java.lang.String name, int number)
           
 
Method Summary
 void addCreature(Creature c)
           
 void addPotion(Potion p)
           
 void destroy()
          Shut down java3D for this level.
 void endCurrentTurn()
          called by CreatureActionScheduler when the queue is empty and Creature.getTurnFinished returns true
 javax.media.j3d.Canvas3D getCanvas3D()
           
 CreatureActionScheduler getCreatureActionScheduler()
          Return the action scheduler of the level.
 Creature getCreatureAtLocation(java.awt.Point where)
           
 double getDistanceToCreature(Creature from, Creature to)
           
 Hero getHero(int index)
           
 Hero getHeroAtLocation(java.awt.Point where)
           
 int getHeroCount()
           
 javax.media.j3d.TransformGroup getLocationTransformGroup(Creature c)
           
 Maze getMaze()
           
 Monster getMonster(int index)
           
 Monster getMonsterAtLocation(java.awt.Point where)
           
 int getMonsterCount()
           
 NavigationBehavior getNavigationBehavior()
           
 int getNumber()
           
 PathFinder getPathFinder()
           
 Potion getPotion(int index)
           
 Potion getPotionAtLocation(java.awt.Point where)
           
 int getPotionCount()
           
 javax.media.j3d.TransformGroup getViewTransformGroup()
           
 void heroesWon()
           
 void removeCreature(Creature c)
           
protected  void removeCreatureFromSceneGraph(Creature c)
           
 void removePotion(Potion p)
           
 void start()
           
protected  void tileConfirmed(java.awt.Point p)
           
protected  void tileSelected(java.awt.Point p)
           
 void updateMiniMap()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MONSTER_RANGE

public static final int MONSTER_RANGE
See Also:
Constant Field Values

MAGIC_ATTACK_RANGE

public static final int MAGIC_ATTACK_RANGE
See Also:
Constant Field Values
Constructor Detail

Level

public Level(Maze maze,
             java.lang.String name,
             int number)
Method Detail

getMaze

public Maze getMaze()

getCreatureActionScheduler

public CreatureActionScheduler getCreatureActionScheduler()
Return the action scheduler of the level.

See Also:
CreatureActionScheduler

addCreature

public void addCreature(Creature c)

removeCreature

public void removeCreature(Creature c)

removeCreatureFromSceneGraph

protected void removeCreatureFromSceneGraph(Creature c)

getLocationTransformGroup

public javax.media.j3d.TransformGroup getLocationTransformGroup(Creature c)

getPathFinder

public PathFinder getPathFinder()

getViewTransformGroup

public javax.media.j3d.TransformGroup getViewTransformGroup()

getCanvas3D

public javax.media.j3d.Canvas3D getCanvas3D()

tileSelected

protected void tileSelected(java.awt.Point p)

tileConfirmed

protected void tileConfirmed(java.awt.Point p)

getDistanceToCreature

public double getDistanceToCreature(Creature from,
                                    Creature to)

endCurrentTurn

public void endCurrentTurn()
called by CreatureActionScheduler when the queue is empty and Creature.getTurnFinished returns true


getNavigationBehavior

public NavigationBehavior getNavigationBehavior()

getHeroCount

public int getHeroCount()

getHero

public Hero getHero(int index)

getMonsterCount

public int getMonsterCount()

getMonster

public Monster getMonster(int index)

getHeroAtLocation

public Hero getHeroAtLocation(java.awt.Point where)

getMonsterAtLocation

public Monster getMonsterAtLocation(java.awt.Point where)

addPotion

public void addPotion(Potion p)

getPotionAtLocation

public Potion getPotionAtLocation(java.awt.Point where)

getPotion

public Potion getPotion(int index)

getPotionCount

public int getPotionCount()

removePotion

public void removePotion(Potion p)

getNumber

public int getNumber()

updateMiniMap

public void updateMiniMap()

getCreatureAtLocation

public Creature getCreatureAtLocation(java.awt.Point where)

heroesWon

public void heroesWon()

start

public void start()

destroy

public void destroy()
Shut down java3D for this level. Call this method with great care. If you are calling this method from within a java3D thread (which is almost always the case in Jaqel) , execution in the current thread is not guaranteed after calling this method. Before calling this method. The canvas3D should be removed from it's container.