# Namespace: Typedefs

## Typedefs

### Type Definitions

#### Typedefs.Ability object

  Ability of an Hero

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `name` | string | name of the ability
  `hook` | AbilityHook | when ability has an effect
  `isOptionnal` | boolean | If true, player will have choice wether to activate ability or not
  `desc` | string | Description of the ability effect

#### Typedefs.AbilityHook "AfterDeploy" | "AfterDiscard" | "AfterRecruit" | "BeforeControl" | "BeforeMaintenance" | "BeforeMilitary"

  Ability Hook

#### Typedefs.AdvRule "popularity" | "discard"

  Possible advanced rules

#### Typedefs.BattleTile object

  Battle Tile object

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `id` | number | unique ID of tile
  `name` | string | name of tile
  `victoryPoints` | number | Number of victory points
  `victories/blue` | number | Number of red player victories
  `victories/red` | number | Number of blue player victories

#### Typedefs.Color "blue" | "red"

  player colors

#### Typedefs.DeckMode "faction" | "draft" | "tournament"

  Values For Deck Mode.

#### Typedefs.Faction "orcs" | "humans" | "elves" | "meca" | "none"

  Faction of a hero

#### Typedefs.GameGlobalState object

  One game global state

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `gameState` | GameStateEnum | Current status of the game
  `allHeroes` | Array.<HeroCard> | Array containing all heroes
  `deckMode` | DeckMode | Deck mode of the game
  `advRules` | Array.<AdvRule> | Array describing the active advandced rules, if any
  `waitingFor/blue` | boolean | If true, we are waiting for blue to play
  `waitingFor/red` | boolean | If true, we are waiting for red to play
  `currentPlayer` | Color | 'both' | Who is current player, can be 'both'
  `battleTiles/left/ofBlue` | Array.<BattleTile> | Battle tiles on left side of blue player
  `battleTiles/center/ofBlue` | Array.<BattleTile> | Battle tiles on center of blue player
  `battleTiles/right/ofBlue` | Array.<BattleTile> | Battle tiles on right side of blue player
  `totalFood` | number | Total food available for players to take
  `` | string | All heroes in JSON format (read from a JSON file)

#### Typedefs.GameStateEnum "0_INIT" | "1_SELECT_DRAFT" | "1_SELECT_FACTION" | "1_SELECT_TOURNAMENT" | "2_CHANGE_UP_TO_3_CARDS"

  Values for Game state.

#### Typedefs.HeroAction "recruit" | "deploy" | "move" | "ability" | "dismiss" | "discard" | "replace"

  Possible action for a hero

#### Typedefs.HeroCard object

  Hero card

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `id` | number | unique ID of hero
  `name` | string | name of hero
  `cost` | number | cost of hero
  `power` | number | power of hero
  `faction` | Faction | faction of hero
  `popularity` | Popularity | popularity attribute of hero
  `isDraftable` | boolean | Is hero available in Draft mode
  `ability` | Ability | Ability of a hero

#### Typedefs.HeroInGame object

  Hero in game

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `id` | number | unique ID of hero
  `position` | HeroPosition | position of hero in game
  `possibleActions` | Array.<HeroAction> | Actions possible on hero

#### Typedefs.HeroPosition "pile" | "hand" | "discard" | "camp" | "battle_left" | "battle_center" | "battle_right"

  Possible position for a hero

#### Typedefs.PlayerAction "supply" | "pass"

  Possible action for a player

#### Typedefs.PlayerGameState object

  Game state for one player

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `name` | string | username of this player
  `color` | Color | color of the player
  `faction` | Faction | "" | Chosen faction (empty if not playing faction mode)
  `draftHeroesIds` | Array.<number> | Will contain the IDs of the heroes selectable for draft mode
  `twelveHeroes` | Array.<HeroInGame> | The 12 Heroes used by player
  `foodInCamp` | number | Number of food in camp
  `foodInBattle/left` | number | Food on left battle field
  `foodInBattle/center` | number | Food on center battle field
  `foodInBattle/right` | number | Food on right battle field
  `actionsPerformed` | Array.<object> | During military phase it will contain actions made by player to be replayed by other
  `` | Array.<PlayerAction> | Actions avalaible for the player

#### Typedefs.Popularity "with" | "without" | "any"

  popularity attribute of a hero

#### Typedefs.StoreData object

  Store data

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `game` | GameGlobalState | The game global state in store
  `bluePlayer` | PlayerGameState | The game state for blue player
  `redPlayer` | PlayerGameState | The game state for red player