Exemple #1
0
        private RomData SelectRom(IReadOnlyEmulator emulator)
        {
            List <RomData> availableRoms = new List <RomData>();

            foreach (var consoleType in emulator.ConsoleNames)
            {
                availableRoms.AddRange(romMgr.GetRoms(consoleType));
            }

            Console.WriteLine(String.Format("The following games are available for {0}:", emulator.EmulatorName));
            for (int i = 1; i <= availableRoms.Count; i++)
            {
                var rom = availableRoms[i - 1];
                Console.WriteLine(String.Format("{0}) {1} (Time Played: {2})", i, rom.FriendlyName, rom.PrettyPrintPlayTime()));
            }

            int selectedRom;

            while (true)
            {
                Console.Write("Enter a game's number ('exit' to quit) > ");
                String input = Console.ReadLine();
                if (input == "exit")
                {
                    return(null);
                }
                if (int.TryParse(input, out selectedRom))
                {
                    if (selectedRom > 0 && selectedRom <= availableRoms.Count)
                    {
                        return(availableRoms[selectedRom - 1]);
                    }
                }
            }
        }
Exemple #2
0
        private void UpdateEmulatorList()
        {
            emulators = emuMgr.GetAvailableEmulators();
            roms      = new List <RomData>();
            var availableConsoles = emulators.SelectMany(f => f.ConsoleNames).Distinct().ToList();

            foreach (var console in availableConsoles)
            {
                roms.AddRange(romMgr.GetRoms(console));
            }

            emulatorTreeView.ChildUpdate(emulators, roms);
        }