| 244 | } |
| 245 | |
| 246 | void MobController::initFromJSONDescriptor(const json& j) |
| 247 | { |
| 248 | m_FocusName = j["focusName"]; |
| 249 | m_zObjectClass = j["objectClass"]; |
| 250 | |
| 251 | if (m_FocusName == "Bed") |
| 252 | m_MobCore = new MobCores::Bed(m_World, m_Entity); |
| 253 | else if (m_FocusName == "Ladder") |
| 254 | m_MobCore = new MobCores::Ladder(m_World, m_Entity); |
| 255 | else if (m_zObjectClass.find("oCMobContainer:") != std::string::npos) |
| 256 | m_MobCore = new MobCores::Container(m_World, m_Entity); |
| 257 | else |
| 258 | m_MobCore = new MobCore(m_World, m_Entity); |
| 259 | |
| 260 | assert(m_MobCore); |
| 261 | |
| 262 | // Apply animation scheme |
| 263 | m_MobCore->setSchemeName(m_FocusName); |
| 264 | |
| 265 | m_MobCore->importCore(j["core"]); |
| 266 | |
| 267 | // Setting the visual AFTER the mobcore is important, since then the scheme-name will be propergated |
| 268 | // since it is derived from the visual-name |
| 269 | } |
| 270 | |
| 271 | void MobController::onMessage(std::shared_ptr<EventMessages::EventMessage> message, Handle::EntityHandle sourceVob) |
| 272 | { |
nothing calls this directly
no test coverage detected