//
// Created by Dan Crosby on 3/23/20.
//

#ifndef EAGLE0_ACTIONRESULTFILTER_HPP
#define EAGLE0_ACTIONRESULTFILTER_HPP

#include <optional>

#include "src/main/cpp/net/eagle0/shardok/library/ShardokCTypes.h"
#include "src/main/cpp/net/eagle0/shardok/library/settings/GameSettings.hpp"
#include "src/main/flatbuffer/net/eagle0/shardok/storage/game_state.hpp"
#include "src/main/protobuf/net/eagle0/shardok/api/action_result_view.pb.h"
#include "src/main/protobuf/net/eagle0/shardok/storage/action_result.pb.h"

namespace shardok {

using GameState = net::eagle0::shardok::storage::fb::GameState;

[[nodiscard]] auto ActionResultFilteredForPlayer(
        const GameState *beforeState,
        const net::eagle0::shardok::api::GameStateView &beforeView,
        const net::eagle0::shardok::api::GameStateView &afterView,
        const SettingsGetter &settings,
        const net::eagle0::shardok::storage::ActionResult &result,
        PlayerId askingPlayer) -> std::optional<net::eagle0::shardok::api::ActionResultView>;

}  // namespace shardok

#endif  // EAGLE0_ACTIONRESULTFILTER_HPP
