Class Replay.Result

java.lang.Object
com.codename1.gaming.platformer.Replay.Result
Enclosing class:
Replay

public static final class Replay.Result extends Object
The outcome of a replay.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Snapshots a world's outcome as it stands, so a client can score the run it just watched with the same rules the server applies to the replay.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    The coins the run collected.
    int
    Deaths during the run.
    long
    The world hash where the replay stopped.
    int
    The points the run scored in the world (pickups, stomps).
    int
    The secrets the run found.
    int
    The tick the goal was reached on, or the log's length if never.
    boolean
    Whether the run reached the goal.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Result

      public Result(PlatformWorld w)

      Snapshots a world's outcome as it stands, so a client can score the run it just watched with the same rules the server applies to the replay.

      Parameters
      • w: the world, usually finished
  • Method Details

    • getScore

      public int getScore()

      The points the run scored in the world (pickups, stomps).

      Returns

      the world score

    • getCoins

      public int getCoins()

      The coins the run collected.

      Returns

      the coin count

    • getSecrets

      public int getSecrets()

      The secrets the run found.

      Returns

      the secret count

    • isComplete

      public boolean isComplete()

      Whether the run reached the goal.

      Returns

      true if complete

    • getTicks

      public int getTicks()

      The tick the goal was reached on, or the log's length if never.

      Returns

      the tick count

    • getDeaths

      public int getDeaths()

      Deaths during the run.

      Returns

      the death count

    • getHash

      public long getHash()

      The world hash where the replay stopped.

      Returns

      the hash