smithers.twisty
Interface AnimatedTwistyPuzzle

All Superinterfaces:
TwistyPuzzle
All Known Implementing Classes:
RubiksCube, SquareOne

public interface AnimatedTwistyPuzzle
extends TwistyPuzzle

Extends the TwistyPuzzle interface to include new methods for animatible twisty puzzles. The units used for timing are entirely up to the whim of the calling class, since the calling class also chooses how much to update the animation by.


Method Summary
 void advanceAnimation(double time)
          Advances the animation by a certain amount of time.
 boolean isAnimating()
          Returns true iff the puzzle is partway through a twist.
 void twist(Twist twist, double time)
          Twists the puzzle over a specified amount of time.
 
Methods inherited from interface smithers.twisty.TwistyPuzzle
getColor, getPolygon, getScale, getTwist, isSolved, scramble, stickerCount, twist
 

Method Detail

twist

void twist(Twist twist,
           double time)
Twists the puzzle over a specified amount of time. Using a time of 0 should apply the twist immediately. Supplying a negative number for the time allows the puzzle to choose the time based on the twist using the absolute value of the time as a maximum.

Parameters:
twist - the twist to make
time - the time to take
Throws:
java.lang.IllegalArgumentException - if time is infinite or NaN

isAnimating

boolean isAnimating()
Returns true iff the puzzle is partway through a twist. If this method returns true, any modifier in TwistyPuzzle may fail with an AnimatingException.

Returns:
true iff the puzzle is animating a twist

advanceAnimation

void advanceAnimation(double time)
Advances the animation by a certain amount of time.

Parameters:
time - the amount of time to advance