<commit_before>/**
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

import * as React from 'react';
import { Map } from 'immutable';
import { Module } from 'redux-typed-modules';

import { cloneDeep } from 'lodash';
import { HUDDragOptions, LayoutMode } from 'utils/HUDDrag';

// layout items
import Chat from './layoutItems/Chat';
import MOTD from './layoutItems/MOTD';
import Build from './layoutItems/Build';
import Warband from './layoutItems/Warband';
import Compass from './layoutItems/Compass';
import CompassTooltip from './layoutItems/CompassTooltip';
import EnemyTarget from './layoutItems/EnemyTarget';
import PlayerHealth from './layoutItems/PlayerHealth';
import FriendlyTarget from './layoutItems/FriendlyTarget';
import ErrorMessages from './layoutItems/ErrorMessages';
import Progression from './layoutItems/Progression';
// import RefillAmmo from './layoutItems/RefillAmmo';
import Announcement from './layoutItems/Announcement';
import Building from './layoutItems/Building';
import ReleaseControl from './layoutItems/ReleaseControl';
import PlayerSiegeHealth from './layoutItems/PlayerSiegeHealth';
// import EnemyTargetSiegeHealth from './layoutItems/EnemyTargetSiegeHealth';
// import FriendlyTargetSiegeHealth from './layoutItems/FriendlyTargetSiegeHealth';
import GameMenu from './layoutItems/GameMenu';
// import Settings from './layoutItems/Settings';
import GameInfo from './layoutItems/GameInfo';
import ItemPlacementModeManager from './layoutItems/ItemPlacementModeManager';
import AbilityQueue from './layoutItems/AbilityQueue';
import ScenarioJoin from './layoutItems/ScenarioJoin';
import ScenarioButton from './layoutItems/ScenarioButton';
import BattleGroups from './layoutItems/BattleGroups';
import BattleGroupWatchList from './layoutItems/BattleGroupWatchList';
import Respawn from './layoutItems/Respawn';
import SelfDamageNumbers from './layoutItems/SelfDamageNumbers';

const localStorageKey = 'cse_hud_layout-state';

// if the local storage value for the reset code doesn't match this, then force a reset
const FORCE_RESET_CODE = '0.8.2';

// if the local storage value for the reset code doesn't match this, then force a reset
const CURRENT_STATE_VERSION: number = 6;

// if the local storage value for the reset code doesn't match this, then force a reset
const MIN_STATE_VERSION_ANCHORED: number = 5;

enum AxisAnchorRelativeTo {
  START = -1,
  CENTER = 0,
  END = 1,
}

export interface Anchor {
  x: AxisAnchorRelativeTo;
  y: AxisAnchorRelativeTo;
}

interface Size {
  width: number;
  height: number;
}
interface AnchoredAxis {<commit_msg>Updating some comments around layout state versioning<commit_after>/**
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

import * as React from 'react';
import { Map } from 'immutable';
import { Module } from 'redux-typed-modules';

import { cloneDeep } from 'lodash';
import { HUDDragOptions, LayoutMode } from 'utils/HUDDrag';

// layout items
import Chat from './layoutItems/Chat';
import MOTD from './layoutItems/MOTD';
import Build from './layoutItems/Build';
import Warband from './layoutItems/Warband';
import Compass from './layoutItems/Compass';
import CompassTooltip from './layoutItems/CompassTooltip';
import EnemyTarget from './layoutItems/EnemyTarget';
import PlayerHealth from './layoutItems/PlayerHealth';
import FriendlyTarget from './layoutItems/FriendlyTarget';
import ErrorMessages from './layoutItems/ErrorMessages';
import Progression from './layoutItems/Progression';
// import RefillAmmo from './layoutItems/RefillAmmo';
import Announcement from './layoutItems/Announcement';
import Building from './layoutItems/Building';
import ReleaseControl from './layoutItems/ReleaseControl';
import PlayerSiegeHealth from './layoutItems/PlayerSiegeHealth';
// import EnemyTargetSiegeHealth from './layoutItems/EnemyTargetSiegeHealth';
// import FriendlyTargetSiegeHealth from './layoutItems/FriendlyTargetSiegeHealth';
import GameMenu from './layoutItems/GameMenu';
// import Settings from './layoutItems/Settings';
import GameInfo from './layoutItems/GameInfo';
import ItemPlacementModeManager from './layoutItems/ItemPlacementModeManager';
import AbilityQueue from './layoutItems/AbilityQueue';
import ScenarioJoin from './layoutItems/ScenarioJoin';
import ScenarioButton from './layoutItems/ScenarioButton';
import BattleGroups from './layoutItems/BattleGroups';
import BattleGroupWatchList from './layoutItems/BattleGroupWatchList';
import Respawn from './layoutItems/Respawn';
import SelfDamageNumbers from './layoutItems/SelfDamageNumbers';

const localStorageKey = 'cse_hud_layout-state';

// if the local storage value for the reset code doesn't match this, then force a reset
const FORCE_RESET_CODE = '0.8.2';

// This is considered the current version we expect the state to be in.
// We set the state to this version when we make a new layout state.
// If we arent forcing a reset and the version on the state is less than the minimum below, 
// we will reset state anyway
const CURRENT_STATE_VERSION: number = 6;

// If we arent forcing a reset, then this is the minimum version. If the current state version is less than
// this minimum, then we consider the state to be too old and we force a reset anyway.
const MIN_STATE_VERSION_ANCHORED: number = 5;

enum AxisAnchorRelativeTo {
  START = -1,
  CENTER = 0,
  END = 1,
}

export interface Anchor {
  x: AxisAnchorRelativeTo;
  y: AxisAnchorRelativeTo;
}

interface Size {
  width: number;
  height: number;
}
interface AnchoredAxis {
{'fraction_non_alphanumeric': 0.10091112257177239, 'fraction_numerical': 0.0041258380608561115, 'mean_word_length': 5.004127966976264, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6812777', 'n_tokens_mistral': 1632, 'n_tokens_neox': 1607, 'n_words': 581}