private void AssertEvent(UnderAttackEvent @event)
 {
     Assert.NotNull(@event);
     Assert.Equal(DateTime.Parse("2019-09-09T13:42:02Z"), @event.Timestamp);
     Assert.Equal(EventName, @event.Event);
     Assert.Equal("You", @event.Target);
 }
Esempio n. 2
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());
     }
 }
Esempio n. 3
0
 internal UnderAttackEvent InvokeEvent(UnderAttackEvent arg)
 {
     if (_api.ValidateEvent(arg))
     {
         UnderAttack?.Invoke(_api, arg);
     }
     return(arg);
 }
Esempio n. 4
0
 internal void InvokeUnderAttackEvent(UnderAttackEvent arg)
 {
     UnderAttackEvent?.Invoke(this, arg);
 }
Esempio n. 5
0
 //2. create get help method
 private void RaiseGetHelp(string weapon)
 {
     UnderAttackEvent?.Invoke(this, weapon);
 }
Esempio n. 6
0
 internal void InvokeUnderAttackEvent(UnderAttackEvent arg) => UnderAttackEvent?.Invoke(null, arg);