Class Drawbridge
java.lang.Object
nl.pim16aap2.animatedarchitecture.structures.drawbridge.Drawbridge
- All Implemented Interfaces:
IStructureComponent
Represents a Drawbridge 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.static RectanglecalculateAnimationRange(double maxRadius, Cuboid cuboid) Calculates the animation range of a drawbridge.calculateAnimationRange(IStructureConst structure) Calculate the animation range for this structure.protected booleanconstructAnimationComponent(IStructureConst structure, AnimationRequestData data) Creates a newIAnimationComponentfor the provided structure and data for this structure component.booleanstatic doublegetMaxRadius(boolean northSouthAligned, Cuboid cuboid, Vector3Di rotationPoint) Calculates the longest possible radius from the rotation point of a drawbridge to another point that is still part of the drawbridge.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, canMovePerpetually, canSkipAnimation, getCurrentToggleDirection, getCycledOpenDirection, isNorthSouthAnimated
-
Constructor Details
-
Drawbridge
public Drawbridge()
-
-
Method Details
-
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.
-
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.
-
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.
-
calculateAnimationRange
Calculates the animation range of a drawbridge.- Parameters:
maxRadius- SeegetMaxRadius(boolean, Cuboid, Vector3Di).cuboid- The cuboid that describes this door.- Returns:
- The animation range.
-
getMaxRadius
public static double getMaxRadius(boolean northSouthAligned, Cuboid cuboid, Vector3Di rotationPoint) Calculates the longest possible radius from the rotation point of a drawbridge to another point that is still part of the drawbridge.- Parameters:
cuboid- The cuboid that describes this drawbridge.rotationPoint- The rotation point of the drawbridge.- Returns:
- The radius between the rotation point of the drawbridge and the animated block furthest from it.
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-