public GamePage(MainWindow win, bool asComp, string t) { this.asComp = asComp; win.asComp = asComp; InitializeComponent(); ParentWindowMain = win; WordsLoader wordsLoader = new WordsLoader(ParentWindowMain); if (!win.DisplayDictionaryErrors(wordsLoader.errorType)) { game = new GameSession(wordsLoader.GetRandomWord(), true); BuildGamePage(); ParentWindowMain.gameStarted = true; ParentWindowMain.gamePageChild = this; } letterToGuessTextBlock.IsEnabled = false; /*cts = new System.Threading.CancellationTokenSource(); * token = cts.Token; * task = new Task(() => { compGuess(); }, token); * task.Start(); * * //if (cts.Token.IsCancellationRequested) return; * cts.Dispose(); * cts = null;*/ compGuess(); }
public GamePage(MainWindow win) { asComp = false; InitializeComponent(); ParentWindowMain = win; WordsLoader wordsLoader = new WordsLoader(ParentWindowMain); if (!win.DisplayDictionaryErrors(wordsLoader.errorType)) { game = new GameSession(wordsLoader.GetRandomWord()); BuildGamePage(); ParentWindowMain.gameStarted = true; ParentWindowMain.gamePageChild = this; } }