/** @namespace Constants*/
export const Constants = {
  //  Server requests status
  /** @namespace Constants.REQ*/
  /**
   * @constant
   * @type {import("type/comm").ReqStatus}
   * @default
   * @memberof Constants.REQ
   */
  REQ_IDLE: 'idle',
  /**
   * @constant
   * @type {import("type/comm").ReqStatus}
   * @default
   * @memberof Constants.REQ
   */
  REQ_REQUESTED: 'requested',
  /**
   * @constant
   * @type {import("type/comm").ReqStatus}
   * @default
   * @memberof Constants.REQ
   */
  REQ_SUCCESS: 'success',
  /**
   * @constant
   * @type {import("type/comm").ReqStatus}
   * @default
   * @memberof Constants.REQ
   */
  REQ_ERROR: 'error',

  // Positions of heroes in game
  /** @namespace Constants.POS*/
  /**
   * @constant
   * @type {import("type/game").HeroPosition}
   * @default
   * @memberof Constants.POS
   */
  POS_PILE: 'pile',
  /**
   * @constant
   * @type {import("type/game").HeroPosition}
   * @default
   * @memberof Constants.POS
   */
  POS_HAND: 'hand',
  /**
   * @constant
   * @type {import("type/game").HeroPosition}
   * @default
   * @memberof Constants.POS
   */
  POS_DISCARD: 'discard',
  /**
   * @constant
   * @type {import("type/game").HeroPosition}
   * @default
   * @memberof Constants.POS
   */
  POS_CAMP: 'camp',
  /**
   * @constant
   * @type {import("type/game").HeroPosition}
   * @default
   * @memberof Constants.POS
   */
  POS_BATTLE_LEFT: 'battle_left',
  /**
   * @constant
   * @type {import("type/game").HeroPosition}
   * @default
   * @memberof Constants.POS
   */
  POS_BATTLE_CENTER: 'battle_center',
  /**
   * @constant
   * @type {import("type/game").HeroPosition}
   * @default
   * @memberof Constants.POS
   */
  POS_BATTLE_RIGHT: 'battle_right',

  // Possible hero actions in game
  /** @namespace Constants.HERO*/
  /**
   * @constant
   * @type {import("type/game").HeroAction}
   * @default
   * @memberof Constants.HERO
   */
  HERO_RECRUIT: 'recruit',
  /**
   * @constant
   * @type {import("type/game").HeroAction}
   * @default
   * @memberof Constants.HERO
   */
  HERO_DEPLOY: 'deploy',
  /**
   * @constant
   * @type {import("type/game").HeroAction}
   * @default
   * @memberof Constants.HERO
   */
  HERO_MOVE: 'move',
  /**
   * @constant
   * @type {import("type/game").HeroAction}
   * @default
   * @memberof Constants.HERO
   */
  HERO_ABILITY: 'ability',
  /**
   * @constant
   * @type {import("type/game").HeroAction}
   * @default
   * @memberof Constants.HERO
   */
  HERO_DISMISS: 'dismiss',
  /**
   * @constant
   * @type {import("type/game").HeroAction}
   * @default
   * @memberof Constants.HERO
   */
  HERO_DISCARD: 'discard',
  /**
   * Only for phase before game starts, when player can replace up to 3 cards (place them under the heroes pile)
   *
   * @constant
   * @type {import("type/game").HeroAction}
   * @default
   * @memberof Constants.HERO
   */
  HERO_REPLACE: 'replace',

  // Possible actions for player in game
  /** @namespace Constants.PLAYER*/
  /**
   * @constant
   * @type {import("type/game").PlayerAction}
   * @default
   * @memberof Constants.PLAYER
   */
  PLAYER_SUPPLY: 'supply',
  /**
   * @constant
   * @type {import("type/game").PlayerAction}
   * @default
   * @memberof Constants.PLAYER
   */
  PLAYER_PASS: 'pass',

  NB_CARDS_TO_PICK_DRAFT: 2,
  NB_CARDS_TO_PICK_TOURNAMENT: 12
};

Constants.install = function(Vue) {
  Vue.prototype.$const = key => {
    return Constants[key];
  };
};
