Exemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        public MainWindow()
        {
            _zipFileRepository = RepositoryManager.GetInstanceOf<IZipFileRepository>();
            _gameRepository = RepositoryManager.GetInstanceOf<IMameGameRepository>();
            _settingsService = ServiceManager.GetInstanceOf<IMameMinerSettingsService>();
            _zipFileService = ServiceManager.GetInstanceOf<IZipFileService>();

            InitializeComponent();

            SetStatus("Main Window Created");
        }
Exemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        public MainWindow()
        {
            _zipFileRepository = RepositoryManager.GetInstanceOf<IZipFileRepository>();
            _gameRepository = RepositoryManager.GetInstanceOf<IMameGameRepository>();
            _settingsService = ServiceManager.GetInstanceOf<IMameMinerSettingsService>();
            _zipFileService = ServiceManager.GetInstanceOf<IZipFileService>();

            InitializeComponent();

            SetStatus("Main Window Created");

            if (_settingsService.GetMameExecutablePath() == string.Empty || _settingsService.GetMameExportPath() == string.Empty || _settingsService.GetMameImportPath() == string.Empty)
            {
                new SettingsWindow(_settingsService).ShowDialog();
            }
        }
Exemplo n.º 3
0
        public RomDetailsView(MameGame game)
        {
            InitializeComponent();
            _game = game;

            if (_game == null)
                return;

            _zipFileRepository = RepositoryManager.GetInstanceOf<IZipFileRepository>();
            _zipFileService = ServiceManager.GetInstanceOf<IZipFileService>();
            _settingsService = ServiceManager.GetInstanceOf<IMameMinerSettingsService>();

            this.GameNameTextBlock.Text = _game.GameName;
            this.GameDescriptionTextBlock.Text = _game.GameDescription;

            Task.Factory.StartNew(() =>
            {

                var hasDuplicates = _game.GroupBy(x => x.RomName).Any(g => g.Count() > 1);

                var sb = new StringBuilder();
                sb.AppendLine(string.Format("Report for : {0}.", game.GameDescription));
                sb.AppendLine(string.Format("Number of Players : {0}.", game.NumberOfPlayers));

                sb.AppendLine("==== Report on Game ====");
                sb.AppendLine(string.Format("Game Driver Status : {0}", game.GameState.ToString()));
                sb.AppendLine(string.Format("Bad Dump? : {0}", game.Any(g => g.BadDump)));
                sb.AppendLine(string.Format("Bad CRC? : {0}", game.Any(g => g.BadCRC)));
                sb.AppendLine(string.Format("Bad SHA1?: {0}", game.Any(g => g.BadSHA1)));

                if (game.Any(g => g.BadDump))
                {
                    sb.AppendLine("At least one rom in the collection is recognized as beeing a bad dump. You may not be able to run this game.");
                }

                if(game.GameState == GameWorkingStateEnum.Preliminary)
                {
                    sb.AppendLine("This game is ony preliminarily developed in Mame. Do not expect it to run.");

                }

                if (hasDuplicates)
                {
                    sb.AppendLine("At least one rom is a duplicate entry from listrom results. You may not be able to run this game.");
                }

                sb.AppendLine("==== Report on Roms ====");
                var missing = _zipFileRepository.FindMissingRoms(game);

                if (missing.Any())
                {
                    foreach (var m in missing)
                    {
                        sb.AppendLine(string.Format("Missing Rom with name of {0}", m.RomName, m.CRC));
                    }

                    sb.AppendLine("You may not be able to play a game generated with missing roms.");
                }
                else
                {
                    sb.AppendLine("No roms missing.");
                }

                Dispatcher.Invoke(() => GameDetailsTextBlock.Text = sb.ToString());

            });
        }
Exemplo n.º 4
0
 public ZipFileService(IZipFileRepository zipFileRepository)
 {
     _zipFileRepository = zipFileRepository;
 }