mooball
    Preparing search index...

    Class AsyncReplayReader

    This is a special structure that is returned from the function Replay.read.

    Index

    Constructors

    Properties

    currentPlayerId: number

    This is a read-only property that always returns -1. It is only added for compatibility with renderers. (And it is only used in the initialization code of renderers.)

    gameState: GameState | null

    An object containing the game state information. Returns null if game is not active.

    maxFrameNo: number

    The maximum frame number in the replay file.

    state: RoomState

    An object containing all information about the current room state.

    Methods

    • Releases the resources that are used by this object.

      Returns void

      void.

    • Extrapolates the current room state and sets the ext variables inside original objects to their newly calculated extrapolated states. Normally designed to be used in renderers.

      Parameters

      • milliseconds: number

        The time to extrapolate the state for in milliseconds.

      Returns RoomState

      The extrapolated room state.

    • Returns the current frame number.

      Returns number

      The current frame number.

    • Returns the current speed coefficient of this replay reader object.

      Returns number

      The current speed coefficient of this replay reader object.

    • Returns the current time.

      Returns number

      The current time in milliseconds.

    • Returns the length of replay content.

      Returns number

      The length of replay content in milliseconds.

    • Called when the destination time or frame number has been reached, which only happens some time after a call to setTime(destinationTime) or setCurrentFrameNo(destinationFrameNo).

      Returns void

      void.

    • Called when the end of replay data has been reached.

      Returns void

      void.

    • Plays the replay until the destinationFrameNo or end of replay is reached. Note that it may take some time to reach the destination frame number(especially if you are trying to rewind time), because the game state data is generated on the fly and not stored in memory. (It would probably use huge amounts of RAM.)

      Parameters

      • destinationFrameNo: number

        The desired frame number.

      Returns void

      void.

    • Changes the speed coefficient of this replay reader object.

      Parameters

      • coefficient: number

        The desired speed coefficient. Must be a real number >=0. Meaning of possible value ranges is as follows:

        • value = 0 : stop replay.
        • 0 < value < 1 : slow-motion replay.
        • value = 1 : normal speed replay.
        • value > 1 : fast-motion replay.

      Returns void

      void.

    • Plays the replay until the destinationTime or end of replay is reached. Note that it may take some time to reach the destination time(especially if you are trying to rewind time), because the game state data is generated on the fly and not stored in memory. (It would probably use huge amounts of RAM.)

      Parameters

      • destinationTime: number

        The desired time in milliseconds.

      Returns void

      void.