コード例 #1
0
 public static WordViewModel GetSpaceLetterWord()
 {
     char spaceLetter = Char.Parse(" ");
     var spaceWord = new WordViewModel();
     spaceWord.Letters.Add(new TypeFaceViewModel(spaceLetter, 14));
     return spaceWord;
 }
コード例 #2
0
ファイル: TyperPanel.cs プロジェクト: abdulbaruwa/AdeTyper
 private double CalculateLeftFromVm(WordViewModel vm)
 {
     var oldValue = _totalWordwWidth;
     var letters = vm.Letters.Count;
     var wordWith = (letters*letterWidth);
     _totalWordwWidth += wordWith;// +horizontalOffset;
     return oldValue;
 }
コード例 #3
0
        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;
        }
コード例 #4
0
        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;
        }
コード例 #5
0
ファイル: TyperPanel.cs プロジェクト: abdulbaruwa/AdeTyper
 private double CalculateTop(WordViewModel vm)
 {
     double wordHeight = letterWidth * _currentRow;
     //double vertOffset = (ActualHeight - letterWidth) /2;
     return _currentRow*vm.WordHeight;// letterHeight;// + vertOffset;
 }
コード例 #6
0
 public void SetFirstWord(WordViewModel wordViewModel)
 {
     if (_currentWord != null) _currentWord.WordProcessed -= CurrentWordWordProcessed;
     _currentWord = wordViewModel;
     _currentWord.WordProcessed += CurrentWordWordProcessed;
 }
コード例 #7
0
 public void AddWord(WordViewModel wordToAdd)
 {
     wordToAdd.GameViewModel = this;
     _words.Add(wordToAdd);
 }
コード例 #8
0
ファイル: MainViewModel.cs プロジェクト: abdulbaruwa/AdeTyper
 public void AddWord(WordViewModel wordToAdd)
 {
     wordToAdd.MainViewModel = this;
     Words.Add(wordToAdd);
 }