-
- All Implemented Interfaces:
-
it.unibo.alchemist.boundary.gui.effects.EffectFX,java.io.Serializable
public abstract class AbstractEffect<P extends Position2D<out P>> implements EffectFX<P>
It models an abstract implementation of the effect interface, implementing default name and visibility properties.
The effect behavior can be implemented via computeDrawCommands template method.
-
-
Field Summary
Fields Modifier and Type Field Description private Stringnameprivate booleanvisibility
-
Method Summary
Modifier and Type Method Description final StringgetName()Gets the name of the effect. final voidsetName(String name)Sets the name of the effect. final voidsetVisibility(boolean visibility)Sets the visibility of the effect. <T> Queue<DrawCommand<P>>computeDrawCommands(Environment<T, P> environment)Computes a queue of commands to Draw something. final booleanisVisible()Gets the visibility of the effect. abstract inthashCode()abstract booleanequals(Object obj)-
-
Method Detail
-
setName
final void setName(String name)
Sets the name of the effect.
- Parameters:
name- the name of the effect to set
-
setVisibility
final void setVisibility(boolean visibility)
Sets the visibility of the effect.
- Parameters:
visibility- the visibility of the effect to set
-
computeDrawCommands
<T> Queue<DrawCommand<P>> computeDrawCommands(Environment<T, P> environment)
Computes a queue of commands to Draw something.
-
isVisible
final boolean isVisible()
Gets the visibility of the effect.
-
hashCode
abstract int hashCode()
-
-
-
-