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

#ifndef ActionResultApplier_hpp
#define ActionResultApplier_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);
auto ApplyResult(
        GameStateW startingState,
        const ActionResultProto& actionResult,
        const SettingsGetter& settings) -> GameStateW;
auto ApplyResults(
        const GameStateW& startingState,
        const std::vector<ActionResultProto>& actionResults,
        const SettingsGetter& settings) -> GameStateW;
}  // namespace shardok

#endif /* ActionResultApplier_hpp */
