Options
All
  • Public
  • Public/Protected
  • All
Menu

perplexed-wars

Index

Variables

Const ACTION_ADD_UNIT

ACTION_ADD_UNIT: string

Const ACTION_ADD_UNIT_CLICK_BUTTON

ACTION_ADD_UNIT_CLICK_BUTTON: string

Const ACTION_CHANGE_GAME_SETTINGS

ACTION_CHANGE_GAME_SETTINGS: string

Const ACTION_GAME_LOOP_INCREMENT_INTERVAL

ACTION_GAME_LOOP_INCREMENT_INTERVAL: "game-loop-increment-interval"

Const ACTION_SELECT_UNIT

ACTION_SELECT_UNIT: string

Const ACTION_VOID

ACTION_VOID: "void-action" = "void-action"

Const isDevelopment

isDevelopment: boolean

Const isTouchDevice

isTouchDevice: boolean

Functions

addNewUnit

addNewUnitImpl

changeGameSettings

clickAddNewUnitButton

clone

  • clone<T>(t: T): T
  • Type parameters

    • T

    Parameters

    • t: T

    Returns T

findUnit

  • findUnit(state: IState, predicate: function): Array<object>
  • Parameters

    Returns Array<object>

gameLoop

  • This is the most important reducer, actionated fromm the game loop (setinterval that is on Game). It's responsible of incrementing the game.time but before that it will call each unintActionResolvers (responsible of unit movement / attack) and game-level and player-level resolvers like the resourceResolver in charge of sum each player's IResource.thisTurnValue to the total value.

    Parameters

    • state: IState
    • action: Action

    Returns IState

getAvailablePlacesFor

  • getAvailablePlacesFor(state: IState, playerId: string): IBox[]
  • Parameters

    • state: IState
    • playerId: string

    Returns IBox[]

getBoxesNearImpl

  • Parameters

    Returns IBox[]

getPathMatrix

  • getPathMatrix(state: IState): number[][]
  • Parameters

    Returns number[][]

getUnitsNearImplementation

  • getUnitsNearImplementation(state: IState, box: IBox, radio: number): Array<object>
  • Parameters

    Returns Array<object>

iterateUnits

  • iterateUnits(state: IState, iterator: function): void
  • Parameters

    Returns void

newUnit

  • newUnit(state: IState, typeId: string, playerId: string): IUnit
  • Parameters

    • state: IState
    • typeId: string
    • playerId: string

    Returns IUnit

range

  • range(n: number): number[]
  • Parameters

    • n: number

    Returns number[]

selectUnit

store

  • store(): any
  • Returns any

Generated using TypeDoc