public FlagshipGameViewModel(FlagshipGame flagshipGame, MainViewModel mainViewModel, FlagshipGameScreen flagshipGameScreen) { FlagshipGameScreen = flagshipGameScreen; MainViewModel = mainViewModel; FlagshipGame = flagshipGame; Initialize(); }
// 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; }
public MainMenuViewModel(MainViewModel mainViewModel, MenuScreen menuScreen) { MainViewModel = mainViewModel; MenuScreen = menuScreen; Initialize(); }