* Derive the numeric unit rank from the string rank * (for soldier units). */
| 2510 | * (for soldier units). |
| 2511 | */ |
| 2512 | void BattleUnit::deriveRank() |
| 2513 | { |
| 2514 | if (_faction == FACTION_PLAYER) |
| 2515 | { |
| 2516 | if (_rank == "STR_COMMANDER") |
| 2517 | _rankInt = 5; |
| 2518 | else if (_rank == "STR_COLONEL") |
| 2519 | _rankInt = 4; |
| 2520 | else if (_rank == "STR_CAPTAIN") |
| 2521 | _rankInt = 3; |
| 2522 | else if (_rank == "STR_SERGEANT") |
| 2523 | _rankInt = 2; |
| 2524 | else if (_rank == "STR_SQUADDIE") |
| 2525 | _rankInt = 1; |
| 2526 | else if (_rank == "STR_ROOKIE") |
| 2527 | _rankInt = 0; |
| 2528 | } |
| 2529 | } |
| 2530 | |
| 2531 | /** |
| 2532 | * this function checks if a tile is visible, using maths. |