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); }
/// <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()); } }
internal UnderAttackEvent InvokeEvent(UnderAttackEvent arg) { if (_api.ValidateEvent(arg)) { UnderAttack?.Invoke(_api, arg); } return(arg); }
internal void InvokeUnderAttackEvent(UnderAttackEvent arg) { UnderAttackEvent?.Invoke(this, arg); }
//2. create get help method private void RaiseGetHelp(string weapon) { UnderAttackEvent?.Invoke(this, weapon); }
internal void InvokeUnderAttackEvent(UnderAttackEvent arg) => UnderAttackEvent?.Invoke(null, arg);