Beispiel #1
0
        public void Block()
        {
            IsBlocked       = true;
            this.fade.color = this.fade.color.With(a: 0.75f);

            Blocked?.Invoke(this);
        }
Beispiel #2
0
 /// <summary>
 /// Raises event 'Blocked'
 /// </summary>
 protected virtual void OnBlocked()
 {
     if (Blocked != null)
     {
         Blocked.Invoke(this, System.EventArgs.Empty);
     }
 }
Beispiel #3
0
 public void GetHit(object sender, DamageEventArgs args)
 {
     if (args.BodyPart == _blocked)
     {
         Blocked?.Invoke(this,
                         new FighterEventArgs(HealthPoints, Name));
     }
     else
     {
         HealthPoints -= args.Damage;
         if (!Dead)
         {
             Wounded?.Invoke(this, args);
         }
     }
 }
Beispiel #4
0
 private void OnConnectionBlocked(ConnectionBlockedEvent @event)
 {
     Blocked?.Invoke(this, new BlockedEventArgs(@event.Reason));
 }
Beispiel #5
0
 protected void OnBlocked(ConnectionBlockedEvent args) => Blocked?.Invoke(this, new ConnectionBlockedEventArgs(args.Reason));
Beispiel #6
0
 /// <summary>
 /// Called in Game object.
 /// </summary>
 public virtual void OnBlocked(Creature blocker)
 {
     Blocked?.Invoke(this, blocker);
 }