public void ClearEvents() { if (OnWordsUpdated != null) { Delegate[] delegates = OnWordsUpdated.GetInvocationList(); for (int i = 0; i < delegates.Length; i++) { OnWordsUpdated -= delegates[i] as WordDelegate; } } }
public void AfterLetterDragged() { ActiveWords = new List <Word>(); foreach (var firstLetter in ActiveLetters.Where(l => l.PreviousLetter == null)) { var current = firstLetter; var letters = new List <LetterController>(); while (current != null) { letters.Add(current); current = current.NextLetter; } letters.Reverse(); ActiveWords.Add(new Word(letters)); } //PrintDebugWords(); OnWordsUpdated?.Invoke(ActiveWords); }