/// <summary> /// Convenience method for getting the text to be displayed on the button /// </summary> /// <param name="button">The button which the text will be displayed on</param> /// <returns>The text that should be shown on the button</returns> public static String GetText(LetterButton button) { if (button.IsAddLetter) { return("+"); } String text = LetterUtil.ConvertToString(button.SelectedLetter); switch (button.Restriction) { case PositionRestriction.START: text += "-"; break; case PositionRestriction.END: text = "-" + text; break; } return(text); }
/// <summary> /// The string representation of this node. (Is just the letter) /// </summary> /// <returns>The letter of the node</returns> public override String ToString() { return(LetterUtil.ConvertToString(Letter)); }
/// <summary> /// Set the value of one of the buttons in the grid with a letter /// </summary> /// <param name="x">The x position of the button</param> /// <param name="y">The y position of the button</param> /// <param name="letter">The new letter value</param> public void SetButtonValue(int x, int y, LetterUtil.Letter letter) { Buttons[y][x].Text = LetterUtil.ConvertToString(letter); Buttons[y][x].SelectedLetter = letter; }