#ifndef EAGLE0_SHARDOK_SERVER_GAME_OVER_RESPONSE_POPULATOR_HPP
#define EAGLE0_SHARDOK_SERVER_GAME_OVER_RESPONSE_POPULATOR_HPP

#include <string>
#include <vector>

#include "src/main/flatbuffer/net/eagle0/shardok/storage/unit.hpp"
#include "src/main/protobuf/net/eagle0/common/common_unit.pb.h"
#include "src/main/protobuf/net/eagle0/common/shardok_internal_interface.pb.h"
#include "src/main/protobuf/net/eagle0/shardok/common/game_status.pb.h"
#include "src/main/protobuf/net/eagle0/shardok/common/player_info.pb.h"
#include "src/main/protobuf/net/eagle0/shardok/storage/action_result.pb.h"

namespace shardok {

using net::eagle0::shardok::storage::fb::Unit;

auto PopulateGameOverResponse(
        const std::string &gameId,
        const net::eagle0::shardok::common::GameStatus &gameStatus,
        const std::vector<net::eagle0::shardok::common::PlayerInfo> &resolvedPlayerInfos,
        const std::vector<net::eagle0::shardok::storage::ResolvedUnit> &resolvedUnits,
        net::eagle0::common::GameOverResponse *gameOverResponse) -> bool;

[[nodiscard]] auto IncludeUnitProtoInReturn(
        const net::eagle0::shardok::storage::ResolvedUnit::UnitStatus &internalStatus) -> bool;

[[nodiscard]] auto FromUnitFb(const Unit &unit) -> net::eagle0::common::CommonUnit;

[[nodiscard]] auto FromInternalStatus(
        const net::eagle0::shardok::storage::ResolvedUnit::UnitStatus internalStatus)
        -> net::eagle0::common::UnitStatus;

}  // namespace shardok

#endif  // EAGLE0_SHARDOK_SERVER_GAME_OVER_RESPONSE_POPULATOR_HPP
