public TankServiceThread() { for (int n = 0; n < 15; n++) { tank[n] = new Data.Tank(-1280 + new Random().Next(32) + 128 * n); } thread = new Thread(new ThreadStart(TankThread)); thread.Start(); }
public TankService() { for (int n = 0; n < 15; n++) { tank[n] = new Data.Tank(-1280 + new Random().Next(32) + 128 * n); } var token = cts.Token; Notify += TankUpdate; Task.Run(() => Update(token), token); }