* Returns the latest ID for the specified object * and increases it. * @param name Object name. * @return Latest ID number. */
| 744 | * @return Latest ID number. |
| 745 | */ |
| 746 | int SavedGame::getId(const std::string &name) |
| 747 | { |
| 748 | std::map<std::string, int>::iterator i = _ids.find(name); |
| 749 | if (i != _ids.end()) |
| 750 | { |
| 751 | return i->second++; |
| 752 | } |
| 753 | else |
| 754 | { |
| 755 | _ids[name] = 1; |
| 756 | return _ids[name]++; |
| 757 | } |
| 758 | } |
| 759 | |
| 760 | /** |
| 761 | * Returns the list of countries in the game world. |