public async void NewGame() { var aa = Attempts; var level = Level; Puzzle?.Hide(); Attempts = null; var p = Combination.CreatePuzzle(level); p.Height = height; p.Hide(); foreach (var a in aa) { a.Empty(); } Attempts = aa; Puzzle = p; OnWon?.BeginInvoke(this, null, null, null); CurrentAttemptIndex = 0; SetAttempt(0); }
public void HandleInput(Vector2 touchPosition) { foreach (var button in _buttons) { if (button.IsTouched(touchPosition)) { if (button.ColorWithName.ColorName == CurrentWord) { OnWon?.Invoke(null, EventArgs.Empty); return; } else { OnLost?.Invoke(null, EventArgs.Empty); return; } } } }
private void YouWon() { OnWon?.BeginInvoke(this, null, null, null); Puzzle.Show(); }
public void Win() { OnWon.Invoke(); }