/// <summary> /// Returns <c>true</c> if the <see cref="WordEntry"/> intersects in any point with <paramref name="other"/> /// </summary> /// <param name="other">The <see cref="WordEntry"/> to test</param> public bool IntersectWith(WordEntry other) { for (int i = 0; i < Name.Length; i++) { for (int j = 0; j < other.Name.Length; j++) { if (Coordinate(i) == other.Coordinate(j)) { return(true); } } } return(false); }
private void AddWord(WordEntry wordEntry) { for (int i = 0; i < wordEntry.Name.Length; i++) { char c = wordEntry.Name[i]; Point pt = wordEntry.Coordinate(i); try { Soup.Matrix[pt.X, pt.Y] = c; Soup.ShadowMatrix[pt.X, pt.Y] = true; } catch (Exception ex) { System.Diagnostics.Debug.Print($"{ex.Message} at ({pt.X}, {pt.Y}) with entry: {wordEntry}"); throw; } } Soup.UsedWords.Add(wordEntry.Name, wordEntry); }