Beispiel #1
0
        public void FortifyDefense(int amount)
        {
            Defense += amount;

            ShieldFortifiedEventArgs e = new ShieldFortifiedEventArgs(amount);

            OnShieldFortified(e);
        }
        public void FortifyDefense_ThrowsFortifyEvent([Values(1, 3)] int fortifyAmount)
        {
            IronBattleShield shield = new IronBattleShield(5, 0, 0);

            _logger.Subscribe(EventType.ShieldFortified, shield);
            shield.FortifyDefense(fortifyAmount);

            List <EventLog> logs = _logger.Logs;

            Assert.AreEqual(1, logs.Count);

            ShieldFortifiedEventArgs e = logs[0].E as ShieldFortifiedEventArgs;

            Assert.NotNull(e);
            Assert.AreEqual(fortifyAmount, e.FortifyAmount);
        }
Beispiel #3
0
 private void _logShieldFortified(object sender, ShieldFortifiedEventArgs e)
 {
     Logs.Add(new EventLog(EventType.ShieldFortified, sender, e));
 }
Beispiel #4
0
 public void OnShieldFortified(ShieldFortifiedEventArgs e)
 {
     ShieldFortified?.Invoke(this, e);
 }