Exemplo n.º 1
0
 private void SetTheme(IClientTheme clientTheme)
 {
     _BackgroundBrush = clientTheme.Background;
     _BackgroundBrush.Freeze();
     _BorderPen = clientTheme.BorderPen;
     _BorderPen.Freeze();
     _BrushBomb = clientTheme.Bomb;
     _BrushBomb.Freeze();
     _BrushInvader1 = clientTheme.Invader1;
     _BrushInvader1.Freeze();
     _BrushInvader2 = clientTheme.Invader2;
     _BrushInvader2.Freeze();
     _BrushInvader3 = clientTheme.Invader3;
     _BrushInvader3.Freeze();
     _BrushMissile = clientTheme.Missile;
     _BrushMissile.Freeze();
     _BrushPlayer = clientTheme.Player;
     _BrushPlayer.Freeze();
     _BrushSaucer = clientTheme.Saucer;
     _BrushSaucer.Freeze();
     _BrushShield = clientTheme.Shield;
     _BrushShield.Freeze();
     _BrushTextGameOver = clientTheme.TextGameOver;
     _BrushTextGameOver.Freeze();
     _BrushTextTitle = clientTheme.TextTitle;
     _BrushTextTitle.Freeze();
     _BrushTextValue = clientTheme.TextValue;
     _BrushTextValue.Freeze();
 }
Exemplo n.º 2
0
 public Game(uint hiscore, IClientTheme clientTheme)
 {
     SetTheme(clientTheme);
     SetBoard();
     SetPlayer();
     HiScore = hiscore;
     Level   = new Level(Screen.Size, PixelSize, this);
 }
Exemplo n.º 3
0
        public Controller_ViewModel(IClientTheme clientTheme)
        {
            Loaded_Command   = new DelegateCommand <UserControl>(Handler_Loaded_Command);
            Unloaded_Command = new DelegateCommand <RoutedEventArgs>(Handler_Unloaded_Command);
            KeyDown_Command  = new DelegateCommand <KeyEventArgs>(Handler_KeyDown_Command);
            KeyUp_Command    = new DelegateCommand <KeyEventArgs>(Handler_KeyUp_Command);

            _keydownhandler = new KeyEventHandler((o, e) => Handler_KeyDown_Command(e));
            _keyuphandler   = new KeyEventHandler((o, e) => Handler_KeyUp_Command(e));

            _hiScoreDirectory = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\inBIM");
            _highscore        = new FileInfo(Path.Combine(_hiScoreDirectory.FullName, "highscore"));

            LoadHighScore();

            Game = new Game(_hiScore, clientTheme);

            _timerGame = new DispatcherTimer()
            {
                Interval = TimeSpan.FromMilliseconds(20)
            };
            _timerGame.Tick += Handler_TimerTick;
        }