Пример #1
0
 /// <summary>
 /// Under attack. Invoke under attack event.
 /// </summary>
 /// <param name="strength"></param>
 public void Attack(int strength)
 {
     if (Life > 0)
     {
         Life -= strength;
         UnderAttackEvent?.Invoke(this, new UnderAttackArgs());
     }
 }
Пример #2
0
 //2. create get help method
 private void RaiseGetHelp(string weapon)
 {
     UnderAttackEvent?.Invoke(this, weapon);
 }
Пример #3
0
 internal void InvokeUnderAttackEvent(UnderAttackEvent arg)
 {
     UnderAttackEvent?.Invoke(this, arg);
 }
Пример #4
0
 internal void InvokeUnderAttackEvent(UnderAttackEvent arg) => UnderAttackEvent?.Invoke(null, arg);