AddCollision() public method

Add a collision to with another unit.
public AddCollision ( CollisionUnit other ) : void
other CollisionUnit The CollisionUnit that was collided with.
return void
Exemplo n.º 1
0
 /// <summary>
 /// Update the collision status between this and the <paramref name="other"/> CollisionUnit.
 /// </summary>
 /// <param name="other">The CollisionUnit to update.</param>
 public void UpdateCollisionsWith(CollisionUnit other)
 {
     if (CollidesWith(other))
     {
         AddCollision(other);
         other.AddCollision(this);
     }
     else
     {
         RemoveCollision(other);
         other.RemoveCollision(this);
     }
 }