public void Dispose() { // Stop sending data ConnectionHandler.Disconnect(this); // Clear the snake from the board foreach (var point in Snake.Body) { Arena.UpdateCell(point.X, point.Y, null); } // Close the websocket PlayerDisconnected.TrySetResult(null); }