Ejemplo n.º 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);
     }
 }
Ejemplo n.º 2
0
        public void Work(int amount)
        {
            Console.WriteLine($"{Name} выполнил {amount} работы");

            if (OnWork != null)
            {
                OnWork.Invoke(new WorkerEventArgument()
                {
                    Name       = this.Name,
                    WorkAmount = amount
                });
            }
        }
Ejemplo n.º 3
0
 public ActionNode(OnWork onWork)
 {
     _onWork = onWork;
 }
Ejemplo n.º 4
0
 public void Plugin(OnWork onEnable, OnWork onDisable, OnWorkTick onUpdate)
 {
     WorkManager.Work work = new WorkManager.Work(onEnable, onUpdate, onDisable);
     work.Enable();
     this.queTasker.Enqueue(work);
 }
Ejemplo n.º 5
0
 public Work(OnWork onEnable, OnWorkTick onUpdate, OnWork onDisable)
 {
     this.OnEnable = onEnable;
     this.OnUpdate = onUpdate;
     this.OnDisable = onDisable;
 }