Пример #1
0
        public MainForm()
        {
            // ParserHelper.ParseAllLevels(@"C:\Users\Computer\Desktop\Others\Super Meat Boy\gamedata\Levels");

            InitializeComponent();
            InitGUI();

            smb = new SMBManager();
            smb2 = new SMBManager();
            isCompare = false;

            if (Program.Settings.AutoUpdate)
            {
                UpdaterFormOptions options = new UpdaterFormOptions
                {
                    WindowIcon = Properties.Resources.smb,
                    Logo = Properties.Resources.potatoSmall,
                    LogoPosition = new Point(15, 5)
                };
                UpdateChecker updateChecker = new UpdateChecker(Program.UpdateURL, "SMBStats", new Version(Application.ProductVersion), true, null, options);
                updateChecker.CheckUpdateAsync(true);
            }

            if (Program.Settings.AutoLoad)
            {
                OpenSaveGameFile(Program.Settings.LastLoadPath);
            }
        }
Пример #2
0
        public SMBChapter(SMBManager smb, int chapterNumber)
        {
            Number = chapterNumber;
            Name = SMBDatabase.ChapterNames[Number - 1];

            MaxLevelCount = SMBHelpers.GetMaxLevelCount(chapterNumber);
            MaxWarpCount = SMBHelpers.GetMaxWarpLevelCount(chapterNumber);
            MaxTotalLevelCount = MaxLevelCount * 2 + MaxWarpCount + (Number < 7 ? 1 : 0);
            MaxBandagesCount = Number < 6 ? 20 : 0;
            MaxTotalCount = MaxTotalLevelCount + MaxBandagesCount;

            Status = (ChapterStatus)smb.GetChapterInfo(Number, ChapterStatType.Status);
            LightCompleted = smb.GetChapterInfo(Number, ChapterStatType.LightCompleted);
            DarkCompleted = smb.GetChapterInfo(Number, ChapterStatType.DarkCompleted);
            WarpCompleted = smb.GetChapterInfo(Number, ChapterStatType.WarpCompleted);
            IsGlitchCompleted = Status.HasFlag(ChapterStatus.GlitchCompleted);
            TotalLevelCompleted = LightCompleted + DarkCompleted + WarpCompleted + (IsGlitchCompleted ? 1 : 0);
            Bandages = smb.GetChapterInfo(Number, ChapterStatType.Bandages);
            TotalCount = TotalLevelCompleted + Bandages;

            LightLevels = GetLevels(smb, LevelType.Light);
            DarkLevels = GetLevels(smb, LevelType.Dark);
            WarpLevels = GetLevels(smb, LevelType.Warp);

            TotalLightTime = LightLevels.Where(x => x.IsCompleted).Sum(x => x.Time);
            TotalDarkTime = DarkLevels.Where(x => x.IsCompleted).Sum(x => x.Time);
            TotalWarpTime = WarpLevels.Where(x => x.IsCompleted).Sum(x => x.Time);
            TotalTime = TotalLightTime + TotalDarkTime + TotalWarpTime;
            TotalLightGradeA = LightLevels.Count(x => x.IsCompleted && x.IsGradeA);
            TotalDarkGradeA = DarkLevels.Count(x => x.IsCompleted && x.IsGradeA);
            TotalLevelsGradeA = TotalLightGradeA + TotalDarkGradeA;
            TotalLightCompletedParTime = LightLevels.Where(x => x.IsCompleted).Sum(x => x.ParTime);
            TotalDarkCompletedParTime = DarkLevels.Where(x => x.IsCompleted).Sum(x => x.ParTime);
            TotalWarpCompletedParTime = WarpLevels.Where(x => x.IsCompleted).Sum(x => x.ParTime);
            TotalCompletedParTime = TotalLightCompletedParTime + TotalDarkCompletedParTime + TotalWarpCompletedParTime;

            SetTexts();
        }
Пример #3
0
        private List<SMBLevel> GetLevels(SMBManager smb, LevelType levelType)
        {
            List<SMBLevel> levels = new List<SMBLevel>();

            int maxLevel = levelType != LevelType.Warp ? MaxLevelCount : MaxWarpCount;

            for (int i = 1; i <= maxLevel; i++)
            {
                SMBLevel info = smb.GetLevelInfo(Number, i, levelType);
                if (info != null) levels.Add(info);
            }

            return levels;
        }