//
//  FireOutAction.hpp
//  eagle0_engine
//
//  Created by Dan Crosby on 2020/04/12.
//  Copyright © 2020 Dan Crosby. All rights reserved.
//

#ifndef NEW_ROUND_ACTION_HPP
#define NEW_ROUND_ACTION_HPP

#include <utility>

#include "src/main/cpp/net/eagle0/shardok/library/GameStateW.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/ShardokAction.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/action_factories/FireOutActionFactory.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/action_factories/FireSpreadActionFactory.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/action_factories/IceAndSnowAdjustmentActionFactory.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/action_factories/UndeadChangeActionFactory.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/settings/GameSettings.hpp"
#include "src/main/flatbuffer/net/eagle0/shardok/storage/hex_map.hpp"

namespace shardok {
using HexMap = net::eagle0::shardok::storage::fb::HexMap;

class NewRoundAction : public ShardokAction {
private:
    [[nodiscard]] auto InternalExecute(
            const GameStateW& currentState,
            const std::shared_ptr<RandomGenerator>& generator) const
            -> vector<ActionResult> override;

    const GameStateW startingGameState;
    const SettingsGetter settings;
    const std::shared_ptr<FireOutActionFactory> fireOutActionFactory;
    const std::shared_ptr<FireSpreadActionFactory> fireSpreadActionFactory;
    const std::shared_ptr<IceAndSnowAdjustmentActionFactory> iceAdjustmentActionFactory;
    const std::shared_ptr<UndeadChangeActionFactory> undeadGrewActionFactory;

public:
    NewRoundAction(
            GameStateW gameState,
            const SettingsGetter& settingsGetter,
            const std::shared_ptr<FireOutActionFactory>& fireOutFact = nullptr,
            const std::shared_ptr<FireSpreadActionFactory>& fireSpreadFact = nullptr,
            const std::shared_ptr<IceAndSnowAdjustmentActionFactory>& iceAdjustFact = nullptr,
            const std::shared_ptr<UndeadChangeActionFactory>& undeadGrewActionFactory = nullptr);
};
}  // namespace shardok

#endif /* NEW_ROUND_ACTION_HPP */
