Beispiel #1
0
 public Client(TcpClient tcpClient, CancellationTokenSource tokenSource)
 {
     _game           = null;
     _tcpClient      = tcpClient;
     _tokenSource    = tokenSource;
     _stream         = _tcpClient.GetStream();
     _packageFactory = new ClientPackageFactory();
     ClientsCount++;
 }
Beispiel #2
0
 public void SetGame(Game.Game game)
 {
     _game = game;
     _game.OnUpdatePositions += units =>
     {
         SendPackage(new UpdatePositionsPackage
         {
             Units = units
         });
     };
 }