Class PotionEffectComponent
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.player.PotionEffectComponent
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionPotionEffectComponent
(short targetLayer, String effectType) Component that affects entities on collision. -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyEffect
(Entity target) Applies component effectvoid
create()
Creates component attached to potion entityboolean
Returns if the two potion has the same effectboolean
Returns if the two potion has the same effectReturns component effectMethods inherited from class com.deco2800.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
PotionEffectComponent
Component that affects entities on collision.- Parameters:
targetLayer
- The physics layer of the target's collider.
-
-
Method Details
-
create
public void create()Creates component attached to potion entity -
getPotionEffect
Returns component effect -
equals
Returns if the two potion has the same effect- Parameters:
other
- the potion to be checked- Returns:
- true if both have the same effect type, false otherwise
- Requires:
- potion.checkEntityType(EntityTypes.POTION) == true
-
equals
Returns if the two potion has the same effect- Parameters:
effectType
- the potion effect type- Returns:
- true if the effect type matches, false otherwise
-
applyEffect
Applies component effect- Parameters:
target
- - the target entity (player)
-