fn retrieve_entity(
        &mut self,
        marker: M,
        storage: &mut WriteStorage<M>,
        entities: &EntitiesRes,
    ) -> Entity {
        if let Some(entity) = self.retrieve_entity_internal(marker.id()) {
            if let Some(mut marker_comp) = storage.get_mut(entity) {
                marker_comp.update(marker);

                return entity;
            }
        }

        let entity = entities.create();
        let marker = self.allocate(entity, Some(marker.id()));

        // It's not possible for this to fail, as there's no way a freshly
        // created entity could be dead this fast.
        storage.insert(entity, marker).unwrap();
        entity
    }
/// Tries to retrieve an entity by the id of the marker;
/// if no entity has a marker with the same id, a new entity
/// will be created and `marker` will be inserted for it.
///
/// In case the entity existed,
/// this method will update the marker data using `Marker::update`.
Tries to retrieve an entity by the id of the marker;
if no entity has a marker with the same id, a new entity
will be created and `marker` will be inserted for it.

In case the entity existed,
this method will update the marker data using `Marker::update`.
Tries to retrieve an entity by the id of the marker ; if no entity has a marker with the same id a new entity will be created and ` marker ` will be inserted for it . In case the entity existed this method will update the marker data using ` Marker :: update ` .
fn retrieve_entity(
        &mut self,
        marker: M,
        storage: &mut WriteStorage<M>,
        entities: &EntitiesRes,
    ) -> Entity {
        if let Some(entity) = self.retrieve_entity_internal(marker.id()) {
            if let Some(mut marker_comp) = storage.get_mut(entity) {
                marker_comp.update(marker);
                return entity;
            }
        }
        let entity = entities.create();
        let marker = self.allocate(entity, Some(marker.id()));
        // It's not possible for this to fail, as there's no way a freshly
        // created entity could be dead this fast.
        storage.insert(entity, marker).unwrap();
        entity
    }
fn retrieve_entity ( & mut self , marker : M , storage : & mut WriteStorage < M > , entities : & EntitiesRes , ) -> Entity { if let Some ( entity ) = self . retrieve_entity_internal ( marker . id ( ) ) { if let Some ( mut marker_comp ) = storage . get_mut ( entity ) { marker_comp . update ( marker ) ; return entity ; } } let entity = entities . create ( ) ; let marker = self . allocate ( entity , Some ( marker . id ( ) ) ) ; // It's not possible for this to fail, as there's no way a freshly // created entity could be dead this fast. storage . insert ( entity , marker ) . unwrap ( ) ; entity }
Tries to retrieve an entity by the id of the marker;
if no entity has a marker with the same id, a new entity
will be created and `marker` will be inserted for it.
Tries to retrieve an entity by the id of the marker ; if no entity has a marker with the same id a new entity will be created and ` marker ` will be inserted for it .
&mut self
marker
M
storage
&mut WriteStorage<M>
entities
&EntitiesRes