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

#ifndef ChargeActionFactory_hpp
#define ChargeActionFactory_hpp

#include "src/main/cpp/net/eagle0/shardok/library/ShardokCommand.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/command_factories/CommandFactory.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/settings/GameSettings.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/util/CombatUtils.hpp"

namespace shardok {

class ChargeCommandFactory : public CommandFactory {
private:
    const SettingsGetter settings;

public:
    explicit ChargeCommandFactory(const SettingsGetter &getter);
    ~ChargeCommandFactory() override = default;

    [[nodiscard]] auto MakeChargeCommand(
            const Unit *attacker,
            const Unit *defender,
            const Terrain *defenderTerrain,
            AttackOrientation attackOrientation) const -> CommandSPtr;

    void AddAvailableCommands(CommandList &commands, const CommandParams &params) const override;

    void AddAvailableChargeCommands(
            CommandList &commands,
            const Unit *unit,
            ActionPoints remainingActionPoints,
            const Coords &position,
            bool isEligibleCharger,
            const PossibleChargees &possibleChargees,
            const HexMap *hexMap,
            const Units *units,
            const vector<PlayerId> &allyPids) const;
};
}  // namespace shardok

#endif /* ChargeActionFactory_hpp */
