| 2063 | } |
| 2064 | |
| 2065 | bool GameMap::addSeat(Seat *s) |
| 2066 | { |
| 2067 | if(s == nullptr) |
| 2068 | { |
| 2069 | OD_LOG_ERR("unexpected null seat"); |
| 2070 | return false; |
| 2071 | } |
| 2072 | |
| 2073 | for(Seat* seat : mSeats) |
| 2074 | { |
| 2075 | if(seat->getId() == s->getId()) |
| 2076 | { |
| 2077 | OD_LOG_ERR("Duplicated seat id=" + Helper::toString(seat->getId())); |
| 2078 | return false; |
| 2079 | } |
| 2080 | } |
| 2081 | mSeats.push_back(s); |
| 2082 | // We set the Seat color value |
| 2083 | const Ogre::ColourValue& colorValue = ConfigManager::getSingleton().getColorFromId(s->getColorId()); |
| 2084 | s->setColorValue(colorValue); |
| 2085 | |
| 2086 | // Add the goals for all seats to this seat. |
| 2087 | for (auto& goal : mGoalsForAllSeats) |
| 2088 | { |
| 2089 | s->addGoal(goal.get()); |
| 2090 | } |
| 2091 | return true; |
| 2092 | } |
| 2093 | |
| 2094 | Seat* GameMap::getSeatById(int id) const |
| 2095 | { |
no test coverage detected