mwg API
    Preparing search index...

    Class UndoHistory<T>

    Type Parameters

    • T
    Index
    • get current(): T | null

      the state at the current point, or null before anything has ever been pushed

      Returns T | null

    • drops everything - a new game, a floor transition, anywhere undoing across the boundary makes no sense

      Returns void

    • Records state as the new current point - the normal "a turn was taken" case. Any redo history beyond the current point is discarded, the same rule undo/redo everywhere follows: taking a new turn after undoing invalidates whatever future it undid away from.

      Parameters

      • state: T

      Returns void

    • steps forward one state and returns it; null when already at the newest state

      Returns T | null

    • steps back one state and returns it; null when already at the oldest retained state

      Returns T | null