Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GameCode

Static utilities to use to generate game codes and convert between formats.

Hierarchy

  • GameCode

Index

Methods

Static V2Parts2Int

  • V2Parts2Int(a: number, b: number, c: number, d: number, e: number, f: number): number
  • Parameters

    • a: number
    • b: number
    • c: number
    • d: number
    • e: number
    • f: number

    Returns number

Static convertIntToString

  • convertIntToString(bytes: number): string
  • Convert a game code from an integer representation to use as a string.

    Parameters

    • bytes: number

    Returns string

    A string representation of the game code.

Static convertStringToInt

  • convertStringToInt(code: string): number
  • Convert a game code from a string representation to use as an integer.

    Parameters

    • code: string

      A game code as a string.

    Returns number

    An integer representation of the game code.

Static convertV1IntToString

  • convertV1IntToString(bytes: number): string
  • Convert a version 1 game code from an integer representation to use as a string.

    Parameters

    • bytes: number

    Returns string

    A string representation of the game code.

Static convertV1StringToInt

  • convertV1StringToInt(code: string): number
  • Convert a version 1 game code from a string representation to use as an integer.

    Parameters

    • code: string

      A version 1 game code as a string, i.e. a 4 letter code.

    Returns number

    An integer representation of the game code.

Static convertV2IntToString

  • convertV2IntToString(bytes: number): string
  • Convert a version 2 game code from an integer representation to use as a string.

    Parameters

    • bytes: number

    Returns string

    A string representation of the game code.

Static convertV2StringToInt

  • convertV2StringToInt(code: string): number
  • Convert a version 2 game code from a string representation to use as an integer.

    Parameters

    • code: string

      A version 2 game code as a string, i.e. a 6 letter code.

    Returns number

    An integer representation of the game code.

Static generateV1

  • generateV1(): number
  • Generate a random version 1 game code.

    Returns number

    An integer representation of the generated game code

Static generateV2

  • generateV2(): number
  • Generate a random version 2 game code.

    Returns number

    An integer representation of the generated game code

Generated using TypeDoc