#pragma once

#include <array>
#include <map>
#include <optional>
#include <string>
#include <vector>

namespace frostbite2D::character {

struct JobConfig {
  std::string name;
  std::map<std::string, int> defaultAvatarList;
};

struct CharacterConfig {
  int jobId = -1;
  std::string jobTag;
  std::string baseJobPath;
  JobConfig baseJobConfig;
  std::map<std::string, std::string> animationPath;
};

struct EquipmentVariation {
  int layer = 0;
  std::string animationGroup;
  std::array<int, 2> imgFormat = {0, 0};
};

struct EquipmentConfig {
  int id = -1;
  std::string path;
  std::string name;
  std::vector<int> usableJobs;
  std::map<int, std::vector<EquipmentVariation>> jobAnimations;
};

bool loadCharacterIndex(std::map<int, std::string>& outIndex);
std::optional<CharacterConfig> loadCharacterConfig(int jobId);

bool loadEquipmentIndex(std::map<int, std::string>& outIndex);
std::optional<EquipmentConfig> loadEquipmentConfig(int equipmentId);

} // namespace frostbite2D::character
