unc.cdva.interactiveitems
Class PathwayEnd

java.lang.Object
  extended by unc.cdva.utils.TaggedObject
      extended by unc.cdva.interactiveitems.InteractiveItem
          extended by unc.cdva.interactiveitems.PathwayEnd
All Implemented Interfaces:
Taggable

public class PathwayEnd
extends InteractiveItem

Pathway end object keeps track of the state of the pathway end. The pathway end object is the object at the end of the pathway obviously (the dam).

Author:
Guillaume Conte

Field Summary
 
Fields inherited from class unc.cdva.interactiveitems.InteractiveItem
direction, position, scaling
 
Constructor Summary
PathwayEnd()
          constructor for a pathway end, it initializes the state of the pathway end.
 
Method Summary
 void crack()
          Sets the state of the dam to cracked (one hit)
 void destroy()
          Sets the state of the dam to destroyed (a terminal state, game should end).
 void hitBySomething()
          A method to indicate that the pathway end was hit by something, advances the state of the dam.
 boolean isCracked()
           
 boolean isDestroyed()
           
 boolean isLeaking()
           
 boolean isOk()
           
 void leak()
          Sets the state of the dam to leaking (two hits, almost destroyed)
 void ok()
          Sets the state of the pathway end.
 
Methods inherited from class unc.cdva.interactiveitems.InteractiveItem
getDirection, getPdsBean, getPosition, getScaling, getState, setDirection, setPds, setPosition, setScaling, setState
 
Methods inherited from class unc.cdva.utils.TaggedObject
createId, equals, getId, hashCode, setId, setId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathwayEnd

public PathwayEnd()
constructor for a pathway end, it initializes the state of the pathway end.

Method Detail

hitBySomething

public void hitBySomething()
A method to indicate that the pathway end was hit by something, advances the state of the dam.


ok

public void ok()
Sets the state of the pathway end.


crack

public void crack()
Sets the state of the dam to cracked (one hit)


leak

public void leak()
Sets the state of the dam to leaking (two hits, almost destroyed)


destroy

public void destroy()
Sets the state of the dam to destroyed (a terminal state, game should end).


isOk

public boolean isOk()
Returns:
True if the dam is in the 'ok' state, false otherwise.

isCracked

public boolean isCracked()
Returns:
True if the dam is in the 'cracked' state, false otherwise.

isLeaking

public boolean isLeaking()
Returns:
True if the dam is in the 'leaking' state, false otherwise.

isDestroyed

public boolean isDestroyed()
Returns:
True if the dam is in the 'destroyed' state, false otherwise.