public bool Check(WordInfo word) => true;
public Result <IWordDrawer> GetDrawer(WordInfo wordInfo) { return(drawers.GetFirst(d => d.Check(wordInfo))); }
public bool Check(WordInfo wordInfo) => wordInfo.Word.Length < 4;
public void DrawWord(Graphics graphics, ImageCreatingOptions options, WordInfo wordInfo, Font font) { graphics.DrawString(wordInfo.Word, font, options.Brush, wordInfo.Rectangle); }
/// <summary> /// Sets the drawer with highest priority that checks given wordInfo to draw next word. /// Priority sets as order of drawers in constructor: earlier position means higher priority. /// </summary> public bool TryGetDrawer(WordInfo wordInfo, out IWordDrawer drawer) { drawer = drawers.FirstOrDefault(d => d.Check(wordInfo)); return(drawer != null); }