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