// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {Army} from "../src/RaidGeld.sol" 

library RaidGeldUtils {
  function calculateUnitPrice(uint8 unit, uint16 units) internal pure returns (uint256) {
    require(unit <= 3, "No matching unit found");
    uint256 price = uint256(unit);
    uint256 unitsAlready = uint256(units);

    // Each level costs 15% more than previous
    uint256 PERCENT_INCREASE = 115;
    for (uint256 i = 0; i < n; i++) {
        newPrice = newPrice * PERCENT_INCREASE / 100;
    }
    return unitBaseCost + (unitBaseCost * 15 / 100);
  }

  function calculateProfitsPerSecond(Army army) internal pure returns (uint256) {
    // Each next unit scales progressivelly better
    uint256 moloch_denier_profit = army.moloch_denier.level;
    uint256 apprentice_profit = army.apprentice.level * 61 / 10;
    uint256 annointed_profit = army.annointed.level * 6 * 64 / 10;
    uint256 champion_profit = army.champion.level * 61 / 10 * 64 / 10 * 67 / 10;
    return moloch_denier_profit + apprentice_profit + annointed_profit + champion_profit;
  }
}
