fortStats property

Map<String, int> fortStats

get total FORT stats of the profile. this is the sum of FORT stats of survivorFORT and researchFORT.

Implementation

Map<String, int> get fortStats {
  int fortitude = 0;
  int resistance = 0;
  int offense = 0;
  int tech = 0;

  for (var fort in [survivorFORT, researchFORT]) {
    for (var key in fort.keys) {
      switch (key) {
        case "fortitude":
          fortitude += fort[key] ?? 0;
          break;

        case "resistance":
          resistance += fort[key] ?? 0;
          break;

        case "offense":
          offense += fort[key] ?? 0;
          break;

        case "tech":
          tech += fort[key] ?? 0;
          break;
      }
    }
  }

  return {
    "fortitude": fortitude,
    "resistance": resistance,
    "offense": offense,
    "tech": tech,
  };
}