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

#ifndef EAGLE0_HEXMAPHELPERS_HPP
#define EAGLE0_HEXMAPHELPERS_HPP

#include <flatbuffers/flatbuffers.h>

#include "FlatbufferWrapper.hpp"
#include "src/main/flatbuffer/net/eagle0/shardok/storage/hex_map.hpp"
#include "src/main/protobuf/net/eagle0/shardok/common/hex_map.pb.h"

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;

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

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

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

}  // namespace shardok::fb

#endif  // EAGLE0_HEXMAPHELPERS_HPP
