//
//  PercentileRollOdds.hpp
//  eagle0_tests
//
//  Created by Dan Crosby on 3/25/18.
//  Copyright © 2018 none. All rights reserved.
//

#ifndef PercentileRollOdds_hpp
#define PercentileRollOdds_hpp

#include <string>
#include <vector>

#include "src/main/protobuf/net/eagle0/shardok/storage/odds.pb.h"

namespace shardok {
typedef net::eagle0::shardok::storage::Odds PercentileRollOdds;
typedef net::eagle0::shardok::storage::Odds_OtherFactor OtherFactor;

double BonusFromStat(double stat);

int16_t AverageBonusFromStats(const std::vector<double> &stats);

OtherFactor MakeOtherFactor(int value, const std::string &id);

PercentileRollOdds MakeOdds(
        int base = 0,
        int terr = 0,
        int weath = 0,
        int wind = 0,
        int statF = 0,
        const std::vector<OtherFactor> &others = std::vector<OtherFactor>());

PercentileRollOdds MakeOdds(
        int base,
        int terr,
        int weath,
        int wind,
        const std::vector<double> &stats,
        const std::vector<OtherFactor> &others = std::vector<OtherFactor>());

int16_t GetTotalOdds(const PercentileRollOdds &odds);

bool PercentileRollSucceeds(const PercentileRollOdds &odds, double roll);

int16_t GetSuccessChance(const PercentileRollOdds &odds);
}  // namespace shardok

#endif /* PercentileRollOdds_hpp */
