Exemplo n.º 1
0
 public Worker(int name, int productivity, GoldMine mine)
 {
     this.name         = name;
     this.mine         = mine;
     this.productivity = productivity;
     new Thread(WorkerWork).Start();
 }
 public Stronghold(List <Worker> listWorkers, GoldMine mine)
 {
     this.listWorkers = listWorkers;
     this.mine        = mine;
     for (int i = 0; i < 3; i++)
     {
         listWorkers.Add(new Worker(listWorkers.Count + 1, 3, mine));
     }
     new Thread(AddNewWorker).Start();
 }
Exemplo n.º 3
0
 static void Main(string[] args)
 {
     List <Worker> woreksList = new List <Worker>();
     GoldMine      gmine      = new GoldMine();
     Stronghold    home       = new Stronghold(woreksList, gmine);
 }