//
// Created by Dan Crosby on 11/4/21.
//

#ifndef EAGLE0_SHARDOK_LIBRARY_FB_HELPERS_HEX_MAP_HELPERS_HPP
#define EAGLE0_SHARDOK_LIBRARY_FB_HELPERS_HEX_MAP_HELPERS_HPP

#include <flatbuffers/flatbuffers.h>

#include "FlatbufferWrapper.hpp"
#include "src/main/flatbuffer/net/eagle0/shardok/storage/hex_map.hpp"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-redundant-constexpr-static-def"
#include "src/main/protobuf/net/eagle0/shardok/common/hex_map.pb.h"
#pragma GCC diagnostic pop

namespace shardok::fb {

using flatbuffers::FlatBufferBuilder;
using flatbuffers::Offset;
using HexMap = net::eagle0::shardok::storage::fb::HexMap;
using HexMapW = Wrapper<HexMap>;
using HexMapProto = net::eagle0::shardok::common::HexMap;

[[nodiscard]] auto ConvertHexMapProto(
        FlatBufferBuilder& fbb,
        const net::eagle0::shardok::common::HexMap& mapProto,
        bool isWinter = false,
        float initialWinterIceIntegrity = 0.0f) -> Offset<HexMap>;

[[nodiscard]] auto ToProto(const HexMap* hexMap) -> HexMapProto;

[[nodiscard]] auto CopyHexMap(const HexMap* hexMap) -> HexMapW;

}  // namespace shardok::fb

#endif  // EAGLE0_SHARDOK_LIBRARY_FB_HELPERS_HEX_MAP_HELPERS_HPP
