ResourceTrader.h 890 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * ResourceTrader.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. */
  9. #pragma once
  10. #include "Nullkiller.h"
  11. namespace NK2AI
  12. {
  13. class ResourceTrader
  14. {
  15. public:
  16. // TODO: Mircea: Maybe include based on how close danger is: X as default + proportion of close danger or something around that
  17. static constexpr float ARMY_GOLD_RATIO_PER_MAKE_TURN_PASS = 0.1f;
  18. static constexpr float EXPENDABLE_BULK_RATIO = 0.5f;
  19. static bool trade(BuildAnalyzer & buildAnalyzer, CCallback & cc, const TResources & freeResources);
  20. static bool tradeHelper(
  21. float expendableBulkRatio,
  22. const IMarket & market,
  23. TResources missingNow,
  24. TResources income,
  25. TResources freeAfterMissingTotal,
  26. const BuildAnalyzer & buildAnalyzer,
  27. CCallback & cc
  28. );
  29. };
  30. }