void IDeferredEventCreator.DispatchEvents()
{
while (containmentChanges.Count > 0)
{
var change = containmentChanges.Dequeue();
switch (change.Change)
{
case ContainmentChangeType.BeganTouching:
if (EntityBeganTouching != null)
EntityBeganTouching(this, change.Entity);
break;
case ContainmentChangeType.StoppedTouching:
if (EntityStoppedTouching != null)
EntityStoppedTouching(this, change.Entity);
break;
case ContainmentChangeType.BeganContaining:
if (VolumeBeganContainingEntity != null)
VolumeBeganContainingEntity(this, change.Entity);
break;
case ContainmentChangeType.StoppedContaining:
if (VolumeStoppedContainingEntity != null)
VolumeStoppedContainingEntity(this, change.Entity);
break;
}
}
}