Class ReadOnlyClock

java.lang.Object
modelarium.clock.ReadOnlyClock

public final class ReadOnlyClock extends Object
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 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