public Word(string category, string word, Texture2D image, GameContent gameContent) { Letters = new LetterValue(gameContent); WordLength = word.Length; Category = category; Image = image; Value = FormatWord(word, Letters); }
public LetterValue(GameContent gameContent) { LetterValue letter; LetterValueList = new List <LetterValue>(); for (int ii = 0; ii < 26; ii++) { letter = new LetterValue(ii, values[ii], gameContent.SpriteList[ii]); LetterValueList.Add(letter); } }
private List <LetterValue> FormatWord(string word, LetterValue Letters) { List <LetterValue> wordLetters = new List <LetterValue>(); for (int ii = 0; ii < word.Length; ii++) { for (int jj = 0; jj < Letters.LetterValueList.Count(); jj++) { if (word[ii] == Letters.LetterValueList[jj].Value) { wordLetters.Add(Letters.LetterValueList[jj]); jj = Letters.LetterValueList.Count(); } } } return(wordLetters); }