| 717 | } |
| 718 | |
| 719 | int Server::getUnitID(Unit unit) |
| 720 | { |
| 721 | if ( !unit ) |
| 722 | return -1; |
| 723 | if (unitLookup.find(unit) == unitLookup.end()) |
| 724 | { |
| 725 | unitLookup[unit] = (int)(unitVector.size()); |
| 726 | unitVector.push_back(unit); |
| 727 | } |
| 728 | return unitLookup[unit]; |
| 729 | } |
| 730 | Unit Server::getUnit(int id) const |
| 731 | { |
| 732 | if (unitVector.size() <= static_cast<unsigned>(id)) |
no test coverage detected