/// <summary> /// Raises the <see cref="E:FightOccured"/> event. /// </summary> /// <param name="args">The <see cref="FightResultEventArgs"/> instance containing the event data.</param> public virtual void OnFightOccured(FightResultEventArgs args) { LastFight = args.Result; freeTime = LastFight.NexFightTime; if (args.Result.Win) { Accountant.RegisterBalanceItem(new BalanceItem { Category = BalanceCategory.Fights, Item = "Бой", Gold = Math.Abs(LastFight.Money), Cristal = Math.Abs(LastFight.Crystals), SmallTicket = false, BigTicket = false, IsProfit = LastFight.Win }); } if (FightOccured != null) { FightOccured(this, args); } }
void machine_FightOccured(object sender, FightResultEventArgs e) { fights.Add(e.Result); if (InvokeRequired) { Invoke(RefreshFightsDelegates); } else { RefreshFights(); } }