Exemple #1
0
        public GameMasterStatsCalculator(string currentGameMasterFileName)
        {
            GameMasterStats = new Settings._GameMasterStats(GameMasterTimestampUtils.FileNameToDateTime(currentGameMasterFileName), PokeConstants.Regions.Length - 1);

            for (int i = 0; i < PokeConstants.Regions.Length; i++)
            {
                _moveSetsStats[i] = new _MoveSetStats();
            }
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="folder"></param>
        /// <returns></returns>
        private IEnumerable <string> GetFileList(string folder)
        {
            // Get the desirable filePaths.
            List <string> filePaths = new List <string>();

            foreach (var filePath in Directory.EnumerateFiles(folder, GAME_MASTER_SEARCH_PATTERN))
            {
                string fileName = Path.GetFileNameWithoutExtension(filePath);

                // Add it if the name contains a valid timestamp.
                if (Int64.TryParse(fileName.Substring(0, 16), System.Globalization.NumberStyles.HexNumber, null, out long dummy))
                {
                    string filePathGameMaster = Path.Combine(folder, fileName);
                    if (!filePaths.Contains(filePathGameMaster))
                    {
                        filePaths.Add(filePathGameMaster);
                    }
                }
            }

            // Sort by the HEX value on the front of the file name, adjusted for Mangling.
            return(filePaths.OrderBy(filePath => 0 - GameMasterTimestampUtils.FileNameToDateTime(filePath).Ticks));
        }