//
// Created by Dan Crosby on 9/15/20.
//

#ifndef EAGLE0_MAPLOADER_HPP
#define EAGLE0_MAPLOADER_HPP

#include <string>
#include <utility>

#include "src/main/protobuf/net/eagle0/shardok/common/hex_map.pb.h"

using HexMapProto = net::eagle0::shardok::common::HexMap;
using std::string;
using std::vector;

class MapNotFoundException : public std::exception {
protected:
    const std::string description;

protected:
    explicit MapNotFoundException(const std::string& n) : description(n + " not found."){};

public:
    [[nodiscard]] auto what() const noexcept -> const char* override { return description.c_str(); }
};

auto LoadMap(const std::string& mapName) -> HexMapProto;

auto LoadMapFromBytes(const string& mapBytes) -> HexMapProto;

auto GetMapNames() -> vector<string>;

#endif  // EAGLE0_MAPLOADER_HPP
