public void AddMove(BattleMove move) { SpecialMove specialMove = move as SpecialMove; if (specialMove != null) { AddSpecialMove(specialMove); } else { _extraSpecialMoves.Add(move); } MoveLearnedEventArgs e = new MoveLearnedEventArgs(move); OnMoveLearned(e); }
public void AddMove_AppropriatelyRaisesEvent_SpecialMove() { BattleMove shieldMove = MoveFactory.Get(BattleMoveType.Shield, "iron shield"); _fighter.AddMove(shieldMove); List <EventLog> logs = _logger.Logs; Assert.AreEqual(1, logs.Count); EventLog log = logs[0]; Assert.AreEqual(EventType.MoveLearned, log.Type); MoveLearnedEventArgs e = log.E as MoveLearnedEventArgs; Assert.NotNull(e); Assert.AreEqual(shieldMove, e.Move); }
private void _logMoveLearned(object sender, MoveLearnedEventArgs e) { Logs.Add(new EventLog(EventType.MoveLearned, sender, e)); }
public void OnMoveLearned(MoveLearnedEventArgs e) { MoveLearned?.Invoke(this, e); }