//
//  FireManager.hpp
//  eagle0
//
//  Created by Dan Crosby on 3/14/18.
//  Copyright © 2018 none. All rights reserved.
//

#ifndef FireManager_hpp
#define FireManager_hpp

#include "CombatDamage.hpp"
#include "PercentileRollOdds.hpp"
#include "src/main/cpp/net/eagle0/common/RandomGenerator.hpp"
#include "src/main/cpp/net/eagle0/shardok/library/settings/GameSettings.hpp"
#include "src/main/flatbuffer/net/eagle0/shardok/storage/weather.hpp"
#include "src/main/protobuf/net/eagle0/shardok/common/terrain.pb.h"

namespace shardok {
using WeatherFb = net::eagle0::shardok::storage::fb::Weather;
using TerrainProto = net::eagle0::shardok::common::Terrain;
using Terrain = net::eagle0::shardok::storage::fb::Terrain;

auto PropensityByTerrain(const Terrain *terrain, const SettingsGetter &settings) -> int;

auto PropensityByTerrain(const TerrainProto &terrain, const SettingsGetter &settings) -> int;

auto PropensityByTerrain(
        const TerrainType &terrainType,
        const TileModifierProto &modifier,
        const SettingsGetter &settings) -> int;

auto GetFireDamage(int troops, double openEndedPercentileRoll1, double openEndedPercentileRoll2)
        -> CombatDamage;

auto GetExtinguishOdds(
        const SettingsGetter &settings,
        const Terrain *terrain,
        const WeatherFb *currentWeather,
        double agility,
        double intelligence,
        bool ownTile) -> PercentileRollOdds;

auto GetStartFireOdds(
        const SettingsGetter &settings,
        const Terrain &terrain,
        const WeatherFb &currentWeather,
        double agility,
        double intelligence,
        bool isMage) -> PercentileRollOdds;

}  // namespace shardok

#endif /* FireManager_hpp */
