* Spend time units if it can. Return false if it can't. * @param tu * @return flag if it could spend the time units or not. */
| 1155 | * @return flag if it could spend the time units or not. |
| 1156 | */ |
| 1157 | bool BattleUnit::spendTimeUnits(int tu) |
| 1158 | { |
| 1159 | if (tu <= _tu) |
| 1160 | { |
| 1161 | _tu -= tu; |
| 1162 | return true; |
| 1163 | } |
| 1164 | else |
| 1165 | { |
| 1166 | return false; |
| 1167 | } |
| 1168 | } |
| 1169 | |
| 1170 | /** |
| 1171 | * Spend energy if it can. Return false if it can't. |
no outgoing calls
no test coverage detected