public static WordViewModel GetSpaceLetterWord()
 {
     char spaceLetter = Char.Parse(" ");
     var spaceWord = new WordViewModel();
     spaceWord.Letters.Add(new TypeFaceViewModel(spaceLetter, 14));
     return spaceWord;
 }
Example #2
0
 private double CalculateLeftFromVm(WordViewModel vm)
 {
     var oldValue = _totalWordwWidth;
     var letters = vm.Letters.Count;
     var wordWith = (letters*letterWidth);
     _totalWordwWidth += wordWith;// +horizontalOffset;
     return oldValue;
 }
        public static WordViewModel GetRandomWord(int wordLength)
        {
            var gameOneViewModel = new GameOneViewModel(new HomeWindowViewModel());
            var wordViewModel = new WordViewModel(gameOneViewModel);
            wordViewModel.WordHeight = 17;

            string alphabets = "abdcdefghijklmnopqrstuvwxyz";
            var random = new Random();

            for (int i = 0; i < wordLength; i++)
            {
                char letter = alphabets[random.Next(alphabets.Length)];
                wordViewModel.Letters.Add(new TypeFaceViewModel(letter, 16));
            }
            return wordViewModel;
        }
        private WordViewModel CreateWordViewModelFromWordString(string word)
        {
            var gameOneViewModel = new GameOneViewModel(new HomeWindowViewModel());
            var wordViewModel = new WordViewModel(gameOneViewModel);
            wordViewModel.WordHeight = 17;

            foreach (var character in word)
            {
                char letter = character;
                wordViewModel.Letters.Add(new TypeFaceViewModel(letter, 16));
            }
            return wordViewModel;
        }
Example #5
0
 private double CalculateTop(WordViewModel vm)
 {
     double wordHeight = letterWidth * _currentRow;
     //double vertOffset = (ActualHeight - letterWidth) /2;
     return _currentRow*vm.WordHeight;// letterHeight;// + vertOffset;
 }
Example #6
0
 public void SetFirstWord(WordViewModel wordViewModel)
 {
     if (_currentWord != null) _currentWord.WordProcessed -= CurrentWordWordProcessed;
     _currentWord = wordViewModel;
     _currentWord.WordProcessed += CurrentWordWordProcessed;
 }
Example #7
0
 public void AddWord(WordViewModel wordToAdd)
 {
     wordToAdd.GameViewModel = this;
     _words.Add(wordToAdd);
 }
Example #8
0
 public void AddWord(WordViewModel wordToAdd)
 {
     wordToAdd.MainViewModel = this;
     Words.Add(wordToAdd);
 }