public void Begin() { var userName = _messageFactory.LoginMessage(); var user = _playerManager.GetByUserName(userName); if (user == null) { var key = _playerManager.Add(new Player { Name = userName }); user = _playerManager.Get(key); } _messageFactory.PlayerStatisticsMessage(user); bool kartoti = true; List <Words> PanaudotiZodziai = new List <Words>() { null }; while (kartoti) { Console.Clear(); var tema = RenkuosiTema(); var zodis = RandomZodzioParinkimas(tema, PanaudotiZodziai); if (zodis == null) { Console.WriteLine("Temoje nebera zodziu, ar norite rinktis kita tema t/n"); } else { _hiddenWordManager = new HiddenWordManager(zodis); bool leidziamaSpeti = true; panaudotiZodziai.Add(zodis); _messageFactory.KartuvesPictureMessage(0); Console.WriteLine(); Console.WriteLine(_hiddenWordManager.GetHiddenWordsStructure()); while (leidziamaSpeti) { string spejimas = _messageFactory.WordInputMessage(); bool arSpetasZodis = ArSpetasZodis(spejimas); if (arSpetasZodis) { bool arTeisinga = ArZodisTeisingas(zodis.Text, spejimas); if (arTeisinga) { _messageFactory.WinMessage(zodis.Text); guessWholeWord = _hiddenWordManager.HiddenWords.HiddenLetterCount; } else { _messageFactory.KartuvesPictureMessage(gyvybiuKiekis); _messageFactory.LostMessage(zodis.Text); } leidziamaSpeti = false; } else { bool arBuvoSpeta = _hiddenWordManager.HiddenWords.IncorrectGuesses.Contains(spejimas); if (!arBuvoSpeta) { _hiddenWordManager.CheckLetter(spejimas); } if (_hiddenWordManager.HiddenWords.IncorrectGuesses.Count == gyvybiuKiekis) { _messageFactory.KartuvesPictureMessage(gyvybiuKiekis); _messageFactory.LostMessage(zodis.Text); leidziamaSpeti = false; } else { Console.Clear(); _messageFactory.KartuvesPictureMessage(_hiddenWordManager.HiddenWords.IncorrectGuesses.Count); _messageFactory.IncorrectLettersListMessage(_hiddenWordManager.HiddenWords.IncorrectGuesses); Console.WriteLine(_hiddenWordManager.GetHiddenWordsStructure()); if (_hiddenWordManager.HiddenWords.HiddenLetterCount == 0) { _messageFactory.WinMessage(zodis.Text); _messageFactory.PlayerStatisticsMessage(user); leidziamaSpeti = false; } } } } _playerManager.AddScoreBoards(GetScoreBoard(zodis, user.PlayerId)); //nors ir atnaujinu duomenu baze cia } guessWholeWord = 0; //bet visada atspauzdina senos duomenu bazes duomenis, neissiaiskinau kodel taip yra _messageFactory.PlayerStatisticsMessage(user); kartoti = _messageFactory.RepeatGameMessage(); } }