public static WordViewModel GetSpaceLetterWord() { char spaceLetter = Char.Parse(" "); var spaceWord = new WordViewModel(); spaceWord.Letters.Add(new TypeFaceViewModel(spaceLetter, 14)); return spaceWord; }
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; }
private double CalculateTop(WordViewModel vm) { double wordHeight = letterWidth * _currentRow; //double vertOffset = (ActualHeight - letterWidth) /2; return _currentRow*vm.WordHeight;// letterHeight;// + vertOffset; }
public void SetFirstWord(WordViewModel wordViewModel) { if (_currentWord != null) _currentWord.WordProcessed -= CurrentWordWordProcessed; _currentWord = wordViewModel; _currentWord.WordProcessed += CurrentWordWordProcessed; }
public void AddWord(WordViewModel wordToAdd) { wordToAdd.GameViewModel = this; _words.Add(wordToAdd); }
public void AddWord(WordViewModel wordToAdd) { wordToAdd.MainViewModel = this; Words.Add(wordToAdd); }