예제 #1
0
        public MainWindow(TrainOfWordsGameConfig config)
        {
            _config = config;

            InitializeComponent();
            KeyDown += OnKeyDown;
            Loaded += OnLoaded;
        }
예제 #2
0
 protected Game(TrainOfWordsGameConfig config)
 {
     Config = config;
     Words = new List<Word>();
     Letters = new Dictionary<string, List<char>>();
     Score = new Score {CorrectTrials = 0, Failures = 0};
     FirstStepFinished = false;
     SecondStepFinished = false;
     ThirdStepFinished = false;
     Config.AllLettersCount = 0;
 }
 public TrainOfWordsConfigPage(string itemId, KinectSensorChooser sensorChooser)
 {
     InitializeComponent();
     SensorChooser = sensorChooser;
     Config = new TrainOfWordsGameConfig
     {
         WindowWidth = (int) Application.Current.MainWindow.Width
     };
     DataContext = Config;
     LayoutUpdated += OnLayoutUpdated;
 }
예제 #4
0
        public FirstLevelGame(TrainOfWordsGameConfig config) : base(config)
        {
            var random = new Random();
            
            //3 chars word
            var number = random.Next(WordsContainer.Words3Chars.Count);
            var wordStr = WordsContainer.Words3Chars[number];
            Words.Add(new Word(wordStr));

            //4 chars word
            number = random.Next(WordsContainer.Words4Chars.Count);
            wordStr = WordsContainer.Words4Chars[number];
            Words.Add(new Word(wordStr));

            //5 chars word
            number = random.Next(WordsContainer.Words5Chars.Count);
            wordStr = WordsContainer.Words5Chars[number];
            Words.Add(new Word(wordStr));

            PrepareLettersAndImages();
        }