mwg API
    Preparing search index...

    Function applyUpkeep

    • Parameters

      Returns number

      import { startingArmy, startingTactics, addTacticalUnit, applyUpkeep } from '@datamoc/mw_games/board';

      const board = startingTactics(6, 6, 'square');
      addTacticalUnit(board, { id: 'scout', owner: 'blue', x: 0, y: 0, hp: 6, maxHp: 6, actions: 2 });
      const army = startingArmy(100);

      applyUpkeep(army, board, 'blue', { incomePerUnit: 5, upkeepPerUnit: 2 });
      console.log(army.currency); // 103 - this turn's net income applied