private async void OnLoaded(object sender, RoutedEventArgs routedEventArgs) { Input = new DefaultInput(TextBox); HistoryListBox.ItemsSource = Input.LastCommands; Output = new DefaultOutput(RichTextBlock); SoundManager = new SoundManager(); var filesFolder = await Package.Current.InstalledLocation.GetFolderAsync("Files"); var commandsStream = await filesFolder.OpenStreamForReadAsync("Commands.xml"); var storyStepsStream = await filesFolder.OpenStreamForReadAsync("StorySteps.xml"); var audioFilesStream = await filesFolder.OpenStreamForReadAsync("Sounds.xml"); Game = new Core.Game( Input, Output, SoundManager, audioFilesStream, commandsStream, storyStepsStream); Game.Start(); TextBox.IsEnabled = true; }
private static void Main(string[] args) { CheckWindowSize(); var defaultsFileStream = new FileStream("Files/Defaults.xml", FileMode.Open); var commandsFileStream = new FileStream("Files/Commands.xml", FileMode.Open); var storyStepsFileStream = new FileStream("Files/StorySteps.xml", FileMode.Open); var soundsFileStream = new FileStream("Files/Sounds.xml", FileMode.Open); var input = new ConsoleInput(); var game = new Core.Game( input, new ConsoleOutput(), new SoundManager(), defaultsFileStream, soundsFileStream, commandsFileStream, storyStepsFileStream); game.Start(); do { CheckWindowSize(); } while (game.IsRunning); }