public void TestGetString() { var letterManager = new LetterManager(); var letterA = new Letter('a', 0); letterManager.AddLetter(letterA); var letterB = new Letter('b', 2); letterManager.AddLetter(letterB); letterManager.AddLetter(new Letter('c', 5)); Assert.AreEqual("a b c", letterManager.GetString()); }
void SubmitEntry() { string submission = entry.GetString(); if (previousSubmissions.Contains(submission)) // repeat entry { //entry.DramaticallySubmit(submission.Length, fizzle: true); entry.DramaticallyClear(); puzzle.FreeAllLetters(); Chain = 1; Debug.Log("Repeat: chain reset"); } else // new entry { if (dm.IsAnagramOf(submission, puzzle.GetString())) // success! { int thisScore = ScoreSubmission(submission); Score += thisScore; previousSubmissions.Add(submission); entry.DramaticallySubmit(thisScore); puzzle.FreeAllLetters(); bool foundQuestWord = qtm.RevealWord(submission); if (foundQuestWord) { // play the arpeggio sfx.PlayArp(); } else { // play a note sfx.PlayScaleNote(Mathf.Min(Chain, 8)); } } else //nope { entry.DramaticallyClear(); puzzle.FreeAllLetters(); Chain = 1; Debug.Log("Non-anagram: chain reset"); } } }