pub fn add(&mut self, entity: Entity, value: T)
    where
        T: AddAssign,
    {
        if self.mask.contains(entity.id()) {
            // SAFETY: we checked the mask, thus it's safe to call
            unsafe {
                *self.inner.get_mut(entity.id()) += value;
            }
        } else {
            // SAFETY: we checked the mask, thus it's safe to call
            unsafe {
                self.inner.insert(entity.id(), value);
            }
            self.mask.add(entity.id());
        }
    }
/// Add a value to the change set. If the entity already have a value in the
/// change set, the incoming value will be added to that.
Add a value to the change set. If the entity already have a value in the
change set, the incoming value will be added to that.
Add a value to the change set . If the entity already have a value in the change set the incoming value will be added to that .
pub fn add(&mut self, entity: Entity, value: T)
    where
        T: AddAssign,
    {
        if self.mask.contains(entity.id()) {
            // SAFETY: we checked the mask, thus it's safe to call
            unsafe {
                *self.inner.get_mut(entity.id()) += value;
            }
        } else {
            // SAFETY: we checked the mask, thus it's safe to call
            unsafe {
                self.inner.insert(entity.id(), value);
            }
            self.mask.add(entity.id());
        }
    }
pub fn add ( & mut self , entity : Entity , value : T ) where T : AddAssign , { if self . mask . contains ( entity . id ( ) ) { // SAFETY: we checked the mask, thus it's safe to call unsafe { * self . inner . get_mut ( entity . id ( ) ) += value ; } } else { // SAFETY: we checked the mask, thus it's safe to call unsafe { self . inner . insert ( entity . id ( ) , value ) ; } self . mask . add ( entity . id ( ) ) ; } }
Add a value to the change set.
Add a value to the change set .
&mut self
entity
Entity
value
T