Class Flag
java.lang.Object
nl.pim16aap2.animatedarchitecture.structures.flag.Flag
- All Implemented Interfaces:
IStructureComponent
Represents a Flag structure type.
-
Nested Class Summary
Nested classes/interfaces inherited from interface nl.pim16aap2.animatedarchitecture.core.structures.IStructureComponent
IStructureComponent.LogHolder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculateAnimationCycleDistance(IStructureConst structure) Calculate the animation cycle distance for this structure.calculateAnimationRange(IStructureConst structure) Calculate the animation range for this structure.protected booleanbooleancanMovePerpetually(IStructureConst structure) Checks if the structure can move perpetually.constructAnimationComponent(IStructureConst structure, AnimationRequestData data) Creates a newIAnimationComponentfor the provided structure and data for this structure component.booleangetCycledOpenDirection(IStructureConst structure) Cycle the toggle direction.getPotentialNewCoordinates(IStructureConst structure) Finds the new minimum and maximum coordinates (represented by aCuboid) of this structure that would be the result of toggling it.inthashCode()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface nl.pim16aap2.animatedarchitecture.core.structures.IStructureComponent
calculateAnimationTime, canSkipAnimation, getCurrentToggleDirection, isNorthSouthAnimated
-
Constructor Details
-
Flag
public Flag()
-
-
Method Details
-
canMovePerpetually
Description copied from interface:IStructureComponentChecks if the structure can move perpetually.This applies to structure types that have no end state, such as a flag, a clock, or a windmill.
This method defaults to
false.- Specified by:
canMovePerpetuallyin interfaceIStructureComponent- Parameters:
structure- The structure to check.- Returns:
trueif the structure can move perpetually,falseotherwise.
-
calculateAnimationCycleDistance
Description copied from interface:IStructureComponentCalculate the animation cycle distance for this structure.This method should not be called directly. Instead, use
Structure.getAnimationCycleDistance(). See the documentation for that method for more information.- Specified by:
calculateAnimationCycleDistancein interfaceIStructureComponent- Parameters:
structure- The structure to calculate the animation cycle distance for.- Returns:
- The distance traveled per animation cycle by the block that travels the furthest.
-
calculateAnimationRange
Description copied from interface:IStructureComponentCalculate the animation range for this structure.This method should not be called directly. Instead, use
Structure.getAnimationRange(). See the documentation for that method for more information.- Specified by:
calculateAnimationRangein interfaceIStructureComponent- Parameters:
structure- The structure to calculate the animation range for.- Returns:
- The animation range for this structure.
-
getCycledOpenDirection
Cycle the toggle direction.See
Structure.getCycledOpenDirection()for more information.Because flags do not actually open in any direction, cycling the openDirection does not do anything.
- Specified by:
getCycledOpenDirectionin interfaceIStructureComponent- Parameters:
structure- The structure to get the cycled open direction for.- Returns:
- The current open direction.
-
constructAnimationComponent
public IAnimationComponent constructAnimationComponent(IStructureConst structure, AnimationRequestData data) Description copied from interface:IStructureComponentCreates a newIAnimationComponentfor the provided structure and data for this structure component.- Specified by:
constructAnimationComponentin interfaceIStructureComponent- Parameters:
structure- The structure to calculate the animation range for.data- The data for the toggle request.- Returns:
- A new
Animatorfor this type of structure.
-
getPotentialNewCoordinates
Description copied from interface:IStructureComponentFinds the new minimum and maximum coordinates (represented by aCuboid) of this structure that would be the result of toggling it.- Specified by:
getPotentialNewCoordinatesin interfaceIStructureComponent- Parameters:
structure- The structure to calculate the animation range for.- Returns:
- The
Cuboidthat would represent the structure if it was toggled right now.
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-