예제 #1
0
 public MainViewModel(FlagshipGame flagshipGame, MainScreen mainScreen)
 {
     MainScreen = mainScreen;
     MainScreenViewModel = new MainMenuViewModel(this, MainScreen.MenuScreen);
     FlagshipGameViewModel = new FlagshipGameViewModel(flagshipGame, this, MainScreen.GameScreen);
     FlagshipGame = flagshipGame;
 }
예제 #2
0
파일: StarRL.cs 프로젝트: mtrupkin/StarRL
        // first time initialization
        private void Initialize()
        {
            Completed = false;

            // initialize game model
            FlagshipGame = new FlagshipGame();

            // intialize console
            Shell = new Libtcod.LibtcodShell("StarRL", 160, 90);

            // intialize view
            var MainScreen = new MainScreen(Shell) { GrabHorizontal = true, GrabVertical = true };

            // initialize view model
            MainViewModel = new MainViewModel(FlagshipGame, MainScreen);

            MainViewModel.DisplayMainMenu();

            Shell.AddControl(MainScreen);
            Shell.Resize();

            // intialize game update tick
            updateTimer = new Timer(100);
            updateTimer.Elapsed += new ElapsedEventHandler(updateTimer_Elapsed);
            updateTimer.Start();

            lastUpdateTime = DateTime.Now;
            lastDrawTime = DateTime.Now;
        }