Registers the entity to an component registry. If the entity has been registered with another registry, then we first unregister the entity
| 57 | /// Registers the entity to an component registry. |
| 58 | /// If the entity has been registered with another registry, then we first unregister the entity |
| 59 | void EveEntity::Register( EveComponentRegistry* registry ) |
| 60 | { |
| 61 | if( m_registry == registry ) |
| 62 | { |
| 63 | return; |
| 64 | } |
| 65 | |
| 66 | if( m_registry != nullptr ) |
| 67 | { |
| 68 | this->UnRegister( m_registry ); |
| 69 | } |
| 70 | |
| 71 | if( registry == nullptr ) |
| 72 | { |
| 73 | return; |
| 74 | } |
| 75 | |
| 76 | registry->Register( this ); |
| 77 | this->RegisterComponents(); |
| 78 | } |
| 79 | |
| 80 | |
| 81 | /// Unregisters the entity, but only if it is registered with the registry, else we just ignore this call |
no test coverage detected