public void HandleCollision(INpc enemy, IProjectile bomb, Constants.Direction side) { BombExplodingProjectile bombCast = (BombExplodingProjectile)bomb; if (bombCast.IsExploded()) { enemy.TakeDamage(bombCast.DamageAmount()); } }
public void HandleCollision(IProjectile projectile, IBlock block, Constants.Direction side) { if (typeof(BombableOpening) != block.GetType()) { return; } IDoor door = (IDoor)block; BombExplodingProjectile bomb = (BombExplodingProjectile)projectile; if (!door.IsOpen && bomb.IsExploded()) { door.OpenDoor(); } }