public override void RespondToAttack(IProjectile attack) { this.Shields += 50; base.RespondToAttack(attack); this.Shields -= 50; }
public override void RespondToAttack(IProjectile attack) { this.Shields += 50; attack.Hit(this); this.Shields -= 50; }
public virtual void RespondToAttack(IProjectile attack) { attack.Hit(this); if (this.Shields<0) { this.Shields = 0; } if (this.Health<0) { this.Health = 0; } }
// Responds to an attack by raising its shields by 50 before the attack and removes them after it. public override void RespondToAttack(IProjectile attack) { if (this.Attacked) { this.Shields += 50; this.Attacked = false; } else { this.Shields -= 50; this.Attacked = true; } }
public override void RespondToAttack(IProjectile attack) { this.Shields += 50; attack.Hit(this); this.Shields -= 50; if (this.Health <= 0) { this.Health = 0; Console.WriteLine(Messages.ShipDestroyed, this.Name); } if (this.Shields <= 0) { this.Shields = 0; } }
public virtual void RespondToAttack(IProjectile attack) { attack.Hit(this); }
public override void RespondToAttack(IProjectile attack) { this.Shields += 50; base.RespondToAttack(attack);//преизползваме базовия клас this.Shields -= 50; }
public abstract void RespondToAttack(IProjectile attack);
public virtual void RespondToAttack(IProjectile projectile) { projectile.Hit(this); }
public virtual void RespondToAttack(IProjectile attack) { attack.Hit(this); if (this.Health <= 0) { this.Health = 0; Console.WriteLine(Messages.ShipDestroyed, this.Name); } if (this.Shields < 0) { this.Shields = 0; } }
public void RespondToAttack(IProjectile attack) { throw new NotImplementedException(); }
public override void RespondToAttack(IProjectile attack) { attack.Hit(this); }
public override void RespondToAttack(IProjectile attack) { }
public virtual void RespondToAttack(IProjectile attack) { }