Class BattleAnimationInstance
java.lang.Object
com.pixelmonmod.pixelmon.api.battles.animation.runtime.BattleAnimationInstance
- All Implemented Interfaces:
ActiveBattleAnimation,ContextHolder
- Direct Known Subclasses:
ClientBattleAnimationInstance,ContextualBattleAnimationInstance
Basic runtime animation instance that delegates behavior to a single action.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BattleAnimationActionprotected final Attackprotected final BattleControllerprotected final PixelmonWrapperprotected intprotected final PixelmonWrapper -
Constructor Summary
ConstructorsConstructorDescriptionBattleAnimationInstance(BattleAnimationAction action, BattleAnimationContext context) -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the action driving this runtime animation.protected voidattack()Returns the attack associated with this animation.voidcleanUp()Cleans up state owned by this animation.Returns the battle controller this animation is attached to.copy(BattleController newController) Creates a copy of this animation attached to another battle controller.booleanReturns whether this animation has finished.target()Returns the Pokemon targeted by the animated action.voidtick()Advances this animation by one battle tick.intticks()Returns the number of 20 TPS animation ticks this animation has been active.user()Returns the Pokemon using the animated action.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pixelmonmod.pixelmon.api.battles.animation.runtime.ActiveBattleAnimation
acknowledgeClient, audience, blocksBattle, cleanUpChannel, getContext, isChannelBusy, isContextAliveMethods inherited from interface com.pixelmonmod.pixelmon.battles.controller.context.ContextHolder
get, getOrDefault, has, remove, set, update
-
Field Details
-
action
-
controller
-
user
-
target
-
attack
-
ticks
protected int ticks
-
-
Constructor Details
-
BattleAnimationInstance
-
-
Method Details
-
action
Returns the action driving this runtime animation.- Returns:
- the backing animation action
-
controller
Description copied from interface:ActiveBattleAnimationReturns the battle controller this animation is attached to.- Specified by:
controllerin interfaceActiveBattleAnimation- Returns:
- the owning battle controller
-
user
Description copied from interface:ActiveBattleAnimationReturns the Pokemon using the animated action.- Specified by:
userin interfaceActiveBattleAnimation- Returns:
- the user Pokemon, or
nullwhen not applicable
-
target
Description copied from interface:ActiveBattleAnimationReturns the Pokemon targeted by the animated action.- Specified by:
targetin interfaceActiveBattleAnimation- Returns:
- the target Pokemon, or
nullwhen not applicable
-
attack
Description copied from interface:ActiveBattleAnimationReturns the attack associated with this animation.- Specified by:
attackin interfaceActiveBattleAnimation- Returns:
- the attack, or
nullwhen not applicable
-
ticks
public int ticks()Description copied from interface:ActiveBattleAnimationReturns the number of 20 TPS animation ticks this animation has been active.- Specified by:
ticksin interfaceActiveBattleAnimation- Returns:
- the active animation tick count
-
tick
public void tick()Description copied from interface:ActiveBattleAnimationAdvances this animation by one battle tick.- Specified by:
tickin interfaceActiveBattleAnimation
-
advanceAnimationTicks
protected void advanceAnimationTicks() -
isFinished
public boolean isFinished()Description copied from interface:ActiveBattleAnimationReturns whether this animation has finished.- Specified by:
isFinishedin interfaceActiveBattleAnimation- Returns:
truewhen the animation is finished
-
cleanUp
public void cleanUp()Description copied from interface:ActiveBattleAnimationCleans up state owned by this animation.- Specified by:
cleanUpin interfaceActiveBattleAnimation
-
copy
Description copied from interface:ActiveBattleAnimationCreates a copy of this animation attached to another battle controller.- Specified by:
copyin interfaceActiveBattleAnimation- Parameters:
newController- the replacement battle controller- Returns:
- the copied animation
-