public GameFacade(IDevice dev) : base(dev) { device = dev; isMusicPlay = "Y"; bool isFirstStart = !device.LoadSettings("music", ref isMusicPlay); if (isFirstStart) { device.SaveSettings("music", isMusicPlay); } screenSwitcher = new Dictionary <ScreenState, ContentProcessorScreen> { { ScreenState.Menu, new MenuScreen(device) }, { ScreenState.Game, new GameScreen(device) }, { ScreenState.Intro, new ComicsScreen(device, "intro", 17) }, { ScreenState.Loose, new ComicsScreen(device, "loose", 10) }, { ScreenState.Win, new ComicsScreen(device, "win", 10) }, { ScreenState.Exit, null } }; currentScreen = isFirstStart ? screenSwitcher[ScreenState.Intro] : screenSwitcher[ScreenState.Menu]; }
public void Update(DateTime currentTime) { ScreenState scrSate = currentScreen.Update(currentTime); if (scrSate != ScreenState.Current) { currentScreen = screenSwitcher[scrSate]; } if (currentScreen == null) { device.Exit(); } }