| 305 | } |
| 306 | |
| 307 | void Entity::registerRemoveEvent(int index, Own<Value>&& old) { |
| 308 | auto& handler = SharedEntityPool.getRemoveHandler(index); |
| 309 | if (!handler.IsEmpty()) { |
| 310 | _oldComs[index] = std::move(old); |
| 311 | SharedEntityPool.updatedEntities.insert(MakeWRef(this)); |
| 312 | handler(this); |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | Value* Entity::getComponent(String name) const { |
| 317 | int index = SharedEntityPool.tryGetIndex(name); |