* Gets the Type of the selected item. * @param selected Currently selected item. * @return The type of the selected item. */
| 739 | * @return The type of the selected item. |
| 740 | */ |
| 741 | enum SellType SellState::getType(size_t selected) const |
| 742 | { |
| 743 | size_t max = _soldiers.size(); |
| 744 | |
| 745 | if (selected < max) |
| 746 | return SELL_SOLDIER; |
| 747 | if (selected < (max += _crafts.size()) ) |
| 748 | return SELL_CRAFT; |
| 749 | if (selected < (max += _hasSci)) |
| 750 | return SELL_SCIENTIST; |
| 751 | if (selected < (max += _hasEng)) |
| 752 | return SELL_ENGINEER; |
| 753 | |
| 754 | return SELL_ITEM; |
| 755 | } |
| 756 | |
| 757 | /** |
| 758 | * Gets the index of the selected item. |
no outgoing calls
no test coverage detected