public MultiPlayerBoardView()
        {
            gameOver        = false;
            gameStarted     = false;
            swappedThisTurn = false;
            interval        = 1000;
            level           = 1;
            clearedRows     = 0;
            score           = 0;
            levelThreshhold = 500;
            countDown       = 4;
            tetreminoTypes  = Enum.GetValues(typeof(Tetremino));
            rand            = new Random((int)DateTime.Now.Ticks * ClientManager.Instance.MyID);
            cell            = new Label[col, row];
            eventTimer      = new Timer();
            encoderTimer    = new Timer();

            myEvents     = EventAggregatorModel.Instance;
            audioManager = AudioManagerModel.Instance;

            myEvents.getAggregator().Subscribe(this);
            audioManager.PauseTheme();

            eventTimer.Elapsed += new ElapsedEventHandler(GameLoop);
            eventTimer.Interval = interval;
            eventTimer.Start();

            encoderTimer.Elapsed += new ElapsedEventHandler(EncodeGrid);
            encoderTimer.Interval = 50;

            InitializeComponent();
            SetupBoard();
        }
Beispiel #2
0
        /// <summary>Initializes a new instance of the <see cref="SettingsViewModel" /> class.</summary>
        /// <param name="_mainWindow">The main window.</param>
        public SettingsViewModel(MainViewModel _mainWindow)
        {
            mainWindow   = _mainWindow;
            audioManager = AudioManagerModel.Instance;

            mainWindow.SetBackground = BACKGROUND_SETTINGS;
            mainWindow.SetShade      = .5;

            CreateKeyList();
            LoadSettings();
        }
Beispiel #3
0
        /// <summary>Initializes a new instance of the <see cref="IntroViewModel" /> class.</summary>
        public IntroViewModel()
        {
            audioManager = AudioManagerModel.Instance;

            eventTimer          = new Timer();
            eventTimer.Elapsed += new ElapsedEventHandler(Intro);
            eventTimer.Interval = 2000;
            eventTimer.Start();

            Title   = "~ By Khalil Daoud ~";
            LogoURL = LOGO;
        }
Beispiel #4
0
        /// <summary>Initializes a new instance of the <see cref="MenuViewModel" /> class.</summary>
        /// <param name="_mainWindow">The main window.</param>
        public MenuViewModel(MainViewModel _mainWindow)
        {
            audioManager = AudioManagerModel.Instance;
            mainWindow   = _mainWindow;
            Version      = Properties.Settings.Default.Version;
            UserName     = Properties.Settings.Default.Name;

            mainWindow.SetBackground = BACKGROUND;
            mainWindow.SetShade      = .25;

            OnUIThread(audioManager.PlayFadeInTheme);
        }
Beispiel #5
0
 public SettingsView()
 {
     audioManager = AudioManagerModel.Instance;
     InitializeComponent();
 }