//
//  ActionResultApplier.hpp
//  eagle0_engine
//
//  Created by Dan Crosby on 1/21/19.
//  Copyright © 2019 none. All rights reserved.
//

#ifndef EAGLE0_SHARDOK_LIBRARY_ACTION_RESULT_APPLIER_ACTION_RESULT_APPLIER_HPP
#define EAGLE0_SHARDOK_LIBRARY_ACTION_RESULT_APPLIER_ACTION_RESULT_APPLIER_HPP

#include <flatbuffers/flatbuffers.h>

#include "src/main/cpp/net/eagle0/shardok/library/GameStateW.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/settings/GameSettings.hpp"
#include "src/main/protobuf/net/eagle0/shardok/storage/action_result.pb.h"

namespace shardok {
using ActionResultProto = net::eagle0::shardok::storage::ActionResult;

// flatbuffers
void MutatingApplyResult(
        GameStateW& mutatingGameState,
        const ActionResultProto& actionResult,
        const SettingsGetter& settings);
[[nodiscard]] auto ApplyResult(
        GameStateW startingState,
        const ActionResultProto& actionResult,
        const SettingsGetter& settings) -> GameStateW;
[[nodiscard]] auto ApplyResults(
        const GameStateW& startingState,
        const std::vector<ActionResultProto>& actionResults,
        const SettingsGetter& settings) -> GameStateW;
}  // namespace shardok

#endif  // EAGLE0_SHARDOK_LIBRARY_ACTION_RESULT_APPLIER_ACTION_RESULT_APPLIER_HPP
