Class ObstacleEventHandler
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.obstacle.ObstacleEventHandler
public class ObstacleEventHandler extends Component
Used to handle events of obstacles and enemies
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classObstacleEventHandler.ObstacleTypeThe types of obstacles and enemies are used to determine the type of entity that triggers the event. - 
Field Summary
Fields Modifier and Type Field Description static booleanlockedstatic booleanlocked_ufostatic booleanlocked2static booleanlocked3 - 
Constructor Summary
Constructors Constructor Description ObstacleEventHandler(ObstacleEventHandler.ObstacleType obstacleType)Construct an ObstacleEventHandler and register the corresponding event according to the obstacleType. - 
Method Summary
Modifier and Type Method Description voidcreate()Called when the entity is created and registered.static booleanisLocked()getter method for lockedstatic booleanisLocked_ufo()getter method for locked_ufostatic booleanisLocked2()getter method for locked2static booleanisLocked3()getter method for locked3static booleanisSpaceshipAttack()getter method for spaceshipAttackstatic voidsetSpaceshipAttack(boolean spaceshipAttack)Setter for spaceshipAttack, used for test.Methods inherited from class com.deco2800.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update 
- 
Field Details
- 
locked
public static boolean locked - 
locked2
public static boolean locked2 - 
locked3
public static boolean locked3 - 
locked_ufo
public static boolean locked_ufo 
 - 
 - 
Constructor Details
- 
ObstacleEventHandler
Construct an ObstacleEventHandler and register the corresponding event according to the obstacleType.- Parameters:
 obstacleType- The types of obstacles.
 
 - 
 - 
Method Details
- 
create
public void create()Description copied from class:ComponentCalled when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished. - 
setSpaceshipAttack
public static void setSpaceshipAttack(boolean spaceshipAttack)Setter for spaceshipAttack, used for test.- Parameters:
 spaceshipAttack- : space ship attack or not
 - 
isLocked
public static boolean isLocked()getter method for locked- Returns:
 - if the plant is locked
 
 - 
isLocked2
public static boolean isLocked2()getter method for locked2- Returns:
 - if the thorns is locked
 
 - 
isLocked3
public static boolean isLocked3()getter method for locked3- Returns:
 - if the meteorite is locked
 
 - 
isLocked_ufo
public static boolean isLocked_ufo()getter method for locked_ufo- Returns:
 - if the spaceship is locked
 
 - 
isSpaceshipAttack
public static boolean isSpaceshipAttack()getter method for spaceshipAttack- Returns:
 - if the spaceshipAttack is attack
 
 
 -