Пример #1
0
 public MegaBuyAccounting(IAccount playerAccount)
 {
     _playerAccount   = playerAccount;
     _currentRate     = new PerCallRate(0);
     _pendingPayments = new List <int>();
     _dayPayment      = new DayPayment();
     World.Subscribe(EventSubscription.Create <HourChanged>(HourChanged, this));
     World.Subscribe(EventSubscription.Create <CallSucceeded>(CallSucceeded, this));
     World.Subscribe(EventSubscription.Create <CallRated>(CallRated, this));
     World.Subscribe(EventSubscription.Create <TechnicalMistakeOccurred>(TechnicalMistakeOccurred, this));
     World.Subscribe(EventSubscription.Create <CallFailed>(CallFailed, this));
     World.Subscribe(EventSubscription.Create <JobChanged>(JobRoleChanged, this));
 }
Пример #2
0
 private void WorkDayEnded()
 {
     _playerAccount.PaySalary(_dayPayment);
     World.Publish(new PlayerNotification("MegaBuy", $"You have been paid MBit - {_dayPayment.Amount()}"));
     _dayPayment = new DayPayment();
 }