예제 #1
0
 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();
 }
예제 #2
0
    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);
    }