/// <summary> /// Kill the IHurtable which intersected with this bullet. /// </summary> /// <param name="i_Hurtable">IHurtable which intersected with this bullet.</param> public void Kill(IHurtable i_Hurtable) { i_Hurtable.GotHurt(this); if ((i_Hurtable is HurtableBullet) && (m_random.Next(100) < sr_chanceToBeDestroyedByBullet)) { Destroy(0); } }
/// <summary> /// Acting for touching intersection. /// </summary> /// <param name="i_Touched">The touched object.</param> /// <param name="i_Toucher">The toucher object.</param> /// <param name="i_IntersectionPoints">All of the intersection points.</param> private void actForHurtableIntersection(IHurtable i_Touched, IHurtable i_Toucher, List <Vector2> i_IntersectionPoints) { if (i_Touched.HurtInCase.HasFlag(eHurtInCase.Touch)) { if (i_Touched != i_Toucher) { i_Touched.GotHurt(i_Toucher, i_IntersectionPoints); } } }