public void Attack(int value) { var punch = (TypeOfPunches)value; int strength = Strength[punch]; PunchingBoxer = false; Punch = punch; ChangeHitpoits = false; BoxingEvent?.Invoke(strength, punch); }
public void Defence(int value, TypeOfPunches type) { PunchingBoxer = true; var punch = type; int agility = Agility[punch]; var nett = value - agility; if (nett > 0) { ChangeHitpoits = true; Hitpoints -= nett; } else if (nett <= 0) { ChangeHitpoits = false; } if (Hitpoints <= 0) { KnockedOut = true; } }