Package modelarium.clock
Class ReadOnlyClock
java.lang.Object
modelarium.clock.ReadOnlyClock
Class for providing a read-only view of a
Clock.
This class wraps a mutable clock so that entities can observe the model's current tick without being able to advance it.
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the tick the model is currently performing.booleanReturns whether the model has performed all of its ticks.intReturns the total number of ticks the model will perform.
-
Method Details
-
currentTick
public int currentTick()Returns the tick the model is currently performing.- Returns:
- the current tick number
-
totalTickCount
public int totalTickCount()Returns the total number of ticks the model will perform.- Returns:
- the total tick count
-
isFinished
public boolean isFinished()Returns whether the model has performed all of its ticks.- Returns:
- true if the current tick has reached the total tick count, false otherwise
-