Class JBombCell

java.lang.Object
  |
  +--CellBasedGame.Cell
        |
        +--JBombCell
Direct Known Subclasses:
JBombBorderCell, JBombGrassCell, JBombWallCell

public abstract class JBombCell
extends Cell
implements Explodable, Tickable

Classe astratta di definizione delle Cell in JBomb

Author:
Marco Mastropaolo (marco.mastropaolo@libero.it / st971422@educ.di.unito.it)

Field Summary
protected  boolean m_bIsExploding
          true se sta esplodendo
protected  JBombGame m_jbGame
          Il JBombGame in cui è contenuta la Cell
 
Fields inherited from class CellBasedGame.Cell
m_Game, m_nX, m_nY
 
Constructor Summary
JBombCell(JBombGame Game, int nX, int nY)
          Costruisce una JBombCell
 
Method Summary
abstract  boolean BlocksFire()
          funzione per sapere se questo oggetto blocca il fuoco o no.
abstract  void Explode(Explodable[][] World)
          funzione per far esplodere un oggetto.
abstract  boolean isAWall(DynamicObject obj)
          Funzione che restituisce true se la cella blocca un dato DynamicObject
 boolean IsExploding()
          Restituisce true se è in fase di esplosione
 boolean isOnFire()
          Funzione che restituisce se sta andando a fuoco la cella o meno
abstract  void paint(java.awt.Graphics g)
           
abstract  void timeTick()
          Funzione richiamata a ogni ciclo
 void walkOver(DynamicObject dyn)
          Funzione richiamata ogni volta che un DynamicObject transita su questa Cell
 
Methods inherited from class CellBasedGame.Cell
changeSelf
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_jbGame

protected JBombGame m_jbGame
Il JBombGame in cui è contenuta la Cell

m_bIsExploding

protected boolean m_bIsExploding
true se sta esplodendo
Constructor Detail

JBombCell

public JBombCell(JBombGame Game,
                 int nX,
                 int nY)
Costruisce una JBombCell
Parameters:
Game - Il gioco in cui è contenuta
nX - la coordinata x della cella
nY - la coordinata y della cella
Method Detail

IsExploding

public boolean IsExploding()
Restituisce true se è in fase di esplosione
Specified by:
IsExploding in interface Explodable

timeTick

public abstract void timeTick()
Funzione richiamata a ogni ciclo
Specified by:
timeTick in interface Tickable

paint

public abstract void paint(java.awt.Graphics g)
Overrides:
paint in class Cell

isAWall

public abstract boolean isAWall(DynamicObject obj)
Funzione che restituisce true se la cella blocca un dato DynamicObject
Parameters:
obj - Il DynamicObject su cui verificare il possibile passaggio
Returns:
true se la cella blocca un dato DynamicObject
Overrides:
isAWall in class Cell

Explode

public abstract void Explode(Explodable[][] World)
funzione per far esplodere un oggetto.
Specified by:
Explode in interface Explodable
Parameters:
World - un array di oggetti Explodable

BlocksFire

public abstract boolean BlocksFire()
funzione per sapere se questo oggetto blocca il fuoco o no.
Specified by:
BlocksFire in interface Explodable

walkOver

public void walkOver(DynamicObject dyn)
Funzione richiamata ogni volta che un DynamicObject transita su questa Cell
Parameters:
dyn - Il DynamicObject in transito

isOnFire

public boolean isOnFire()
Funzione che restituisce se sta andando a fuoco la cella o meno