# Module: Types - All project constants and types

### Type Definitions

#### Ability

Ability of an Hero

##### Type:

- object

##### Properties:

Name | Type | Description
--- | --- | ---
`name` | string | name of the ability
`hook` | module:Types.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

Source:
  - server/src/client-server-shared/types.js, line 45

#### BattleTile

Battle Tile object

##### Type:

- 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

Source:
  - server/src/client-server-shared/types.js, line 68

#### GameGlobalState

One game global state

##### Type:

- object

##### Properties:

Name | Type | Description
--- | --- | ---
`gameState` | module:Types.GameStateEnum | Current status of the game
`allHeroes` | Array.<module:Types.HeroCard> | Array containing all heroes
`deckMode` | module:Types.DeckMode | Deck mode of the game
`advRules` | Array.<module:Types.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.<module:Types.BattleTile> | Battle tiles on left side of blue player
`battleTiles/center/ofBlue` | Array.<module:Types.BattleTile> | Battle tiles on center of blue player
`battleTiles/right/ofBlue` | Array.<module:Types.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)

Source:
  - server/src/client-server-shared/types.js, line 79

#### HeroCard

Hero card

##### Type:

- object

##### 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` | module:Types.Faction | faction of hero
`popularity` | module:Types.Popularity | popularity attribute of hero
`isDraftable` | boolean | Is hero available in Draft mode
`ability` | Ability | Ability of a hero

Source:
  - server/src/client-server-shared/types.js, line 54

#### HeroInGame

Hero in game

##### Type:

- object

##### Properties:

Name | Type | Description
--- | --- | ---
`id` | number | unique ID of hero
`position` | number | position of hero in game
`possibleActions` | number | Actions possible on hero

Source:
  - server/src/client-server-shared/types.js, line 96