2025-09-08 16:44:26 +02:00
|
|
|
/*
|
|
|
|
|
* ResourceTrader.h, part of VCMI engine
|
|
|
|
|
*
|
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
|
*
|
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
|
*/
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "Nullkiller.h"
|
|
|
|
|
|
|
|
|
|
namespace NK2AI
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
class ResourceTrader
|
|
|
|
|
{
|
|
|
|
|
public:
|
2025-09-10 01:42:56 +02:00
|
|
|
// TODO: Mircea: Maybe include based on how close danger is: X as default + proportion of close danger or something around that
|
|
|
|
|
static constexpr float ARMY_GOLD_RATIO_PER_MAKE_TURN_PASS = 0.1f;
|
2025-09-12 08:08:18 +02:00
|
|
|
static constexpr float EXPENDABLE_BULK_RATIO = 0.5f;
|
2025-09-10 01:42:56 +02:00
|
|
|
|
|
|
|
|
static bool trade(BuildAnalyzer & buildAnalyzer, CCallback & cc, const TResources & freeResources);
|
2025-09-08 16:44:26 +02:00
|
|
|
static bool tradeHelper(
|
2025-09-10 01:42:56 +02:00
|
|
|
float expendableBulkRatio,
|
|
|
|
|
const IMarket & market,
|
2025-09-08 16:44:26 +02:00
|
|
|
TResources missingNow,
|
|
|
|
|
TResources income,
|
|
|
|
|
TResources freeAfterMissingTotal,
|
2025-09-10 01:42:56 +02:00
|
|
|
const BuildAnalyzer & buildAnalyzer,
|
|
|
|
|
CCallback & cc
|
2025-09-08 16:44:26 +02:00
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|