Class TDesign

Hierarchy

  • TDesign

Constructors

Properties

boardConnectionGraph: number[][]
directionIds: number[]
directionNames: string[]
gameOptions: GameBehaviorOptions
groupedMovements: Record<number, Movement[]>
initialGamePosition: {
    location: number;
    piece: TPiece;
}[]
locationIds: number[]
locationNames: string[]
modes: number[]
movements: Movement[]
pieceNames: {}

Type declaration

    pieces: {}

    Type declaration

      playerNames: string[]
      plugins: Plugin[]
      repeat: number
      rotationallySymmetricDirections: number[][]
      turns: {
          modes: number[];
          player: number;
      }[]
      zoneNames: {}

      Type declaration

        zones: {}

        Type declaration

          Methods

          • Return a list of all direction ids (starts from 0)

            Returns

            a list of all direction ids

            Returns number[]

          • Return a list of all location ids (starts from 1)

            Returns

            a list of all location ids

            Returns number[]

          • Return a list of all player ids (starts from 1)

            Returns

            a list of all player ids

            Returns number[]

          • Classify piece movement according to a move mode

            Returns void

          • Return a new piece instance.

            Returns

            new piece

            Parameters

            • type: number

              an id of the piece type

            • player: number

              an id of a player who owns the piece

            Returns TPiece

          • Parameters

            • dir: number

            Returns string

          • Return a current player id.

            Returns

            current player id

            Parameters

            • turn: number

            Returns number

          • Returns

            Parameters

            • dir: number
            • player: number = 0

            Returns number

          • Return a game board at the time when the game started. If it doesn't exist, create the initial board from the game design.

            Returns

            an initial game state

            Parameters

            • Optional plugins: Plugin[]

            Returns TBoard

          • Return a player who is going to make a move in the next turn.

            Returns

            next player id

            Parameters

            • player: number

              current player id

            Returns number

          • Return the next turn id.

            Returns

            next turn id

            Parameters

            Returns number

          • Return a piece type id that corresponds to the given piece name

            Returns

            a piece type id

            Parameters

            • pieceType: number

            Returns string

          • Return a piece type id that corresponds to the given piece name

            Returns

            a piece type id

            Parameters

            • name: string

              a piece name

            Returns number

          • Return a player name that corresponds to the given player id

            Returns

            a numerical player ID

            Parameters

            • playerName: string

              a player name

            Returns number

          • Return a player id that corresponds to the given player name

            Returns

            a player name

            Parameters

            • playerID: number

              a numerical player ID

            Returns string

          • Return whether the player is in the given zone.

            Parameters

            • player: number

              player id

            • loc: number

              location id

            • zone: number

              zone id

            Returns boolean

          • Return a location name that corresponds to the given location id

            Returns

            a location name

            Parameters

            • loc: number

              a location id

            Returns string

          • Return a new piece location after a player makes a move from a current location toward a given direction

            Returns

            new location id (null if it is not found)

            Parameters

            • player: number

              player id

            • loc: number

              current location of the piece

            • dir: number

              direction toward which the player is going to make a move

            Returns number

          • Parameters

            • plugins: Plugin[]

            Returns void

          • Return a direction id that corresponds to the given direction name

            Returns

            a direction id

            Parameters

            • name: string

              a direction name

            Returns number

          • Return an location corresponding to the given location name

            Returns

            a location id

            Parameters

            • name: string

              a location name

            Returns number

          Generated using TypeDoc