import { Reviver } from "../utils/JSONReviver";

interface GangTerritory {
  power: number;
  territory: number;
}

export let AllGangs: {
  [key: string]: GangTerritory;
} = {
  "Slum Snakes": {
    power: 1,
    territory: 1 / 7,
  },
  Tetrads: {
    power: 1,
    territory: 1 / 7,
  },
  "The Syndicate": {
    power: 1,
    territory: 1 / 7,
  },
  "The Dark Army": {
    power: 1,
    territory: 1 / 7,
  },
  "Speakers for the Dead": {
    power: 1,
    territory: 1 / 7,
  },
  NiteSec: {
    power: 1,
    territory: 1 / 7,
  },
  "The Black Hand": {
    power: 1,
    territory: 1 / 7,
  },
};

export function resetGangs(): void {
  AllGangs = {
    "Slum Snakes": {
      power: 1,
      territory: 1 / 7,
    },
    Tetrads: {
      power: 1,
      territory: 1 / 7,
    },
    "The Syndicate": {
      power: 1,
      territory: 1 / 7,
    },
    "The Dark Army": {
      power: 1,
      territory: 1 / 7,
    },
    "Speakers for the Dead": {
      power: 1,
      territory: 1 / 7,
    },
    NiteSec: {
      power: 1,
      territory: 1 / 7,
    },
    "The Black Hand": {
      power: 1,
      territory: 1 / 7,
    },
  };
}

export function loadAllGangs(saveString: string): void {
  AllGangs = JSON.parse(saveString, Reviver);
}
