Class Replay
java.lang.Object
nz.ac.vuw.ecs.swen225.gp6.recorder.Replay
- All Implemented Interfaces:
Runnable
Class for replaying a recorded game. The Replay class observes the App to be updated of the time,
to make sure actions are in sync with the game. This allows the App to still have control of the
game during replay.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionautoPlay()Method enables the autoPlay functionality.load(int slot) Load method will load the game from the given file name.Method to pause the autoplay feature.voidrun()voidSets the Replay object up with an App.speedMultiplier(float speed) Method sets the speed of the autoplay.step()Method queues the next action in the timeline if available.Method exits the replay mode.
-
Field Details
-
INSTANCE
The singleton instance of the Replay class.
-
-
Method Details
-
setReplay
Sets the Replay object up with an App. -
run
public void run() -
load
Load method will load the game from the given file name.- Parameters:
slot- the slot number to load the game from.- Returns:
- this replay object to chain methods.
-
step
Method queues the next action in the timeline if available. If there is no next action, the method will pop up a message.- Returns:
- this replay object to chain methods.
-
autoPlay
Method enables the autoPlay functionality.- Returns:
- this replay object to chain methods.
-
pauseReplay
Method to pause the autoplay feature.- Returns:
- this replay object to chain methods.
-
speedMultiplier
Method sets the speed of the autoplay.- Parameters:
speed- the speed to set the replay to.- Returns:
- this replay object to chain methods.
-
stopReplay
Method exits the replay mode.- Returns:
- this replay object to chain methods.
-