Example #1
0
 public void StartWork(int duration)
 {
     Console.WriteLine($"User {this.name} with skill-level {this.skillLevel} started to work  ");
     OnWork?.Invoke(duration);
     if (duration > 5000)
     {
         skillLevel++;
         OnUpgrade?.Invoke(1);
     }
 }
Example #2
0
        public void Work(int amount)
        {
            Console.WriteLine($"{Name} выполнил {amount} работы");

            if (OnWork != null)
            {
                OnWork.Invoke(new WorkerEventArgument()
                {
                    Name       = this.Name,
                    WorkAmount = amount
                });
            }
        }