Exemplo n.º 1
0
        /// <summary>
        /// Player plays a move
        /// </summary>
        /// <param name="word"></param>
        public bool PlayAsPlayer(string word)
        {
            if (CanPlay())
            {
                bool valid = WordProcessor.IsValid(word, StartLetter);

                if (valid)
                {
                    StartLetter = word.LastLetter();

                    if (StartLetter == "ğ")
                    {
                        StartLetter = "g";
                    }

                    PlayerWords.Add(new ListModel(word));

                    DeletePreviousWords();

                    PlayerScore += word.Length * 1;
                }

                PlayAsAI();

                return(valid);
            }
            else
            {
                PopupNavigation.Instance.PushAsync(new FinishPopup(GameState.Lose));
            }

            return(false);
        }
Exemplo n.º 2
0
        void DeletePreviousWords()
        {
            if (PlayerWords.Count > 6)
            {
                PlayerWords.RemoveAt(0);
            }

            if (AIWords.Count > 6)
            {
                AIWords.RemoveAt(0);
            }
        }