Пример #1
0
        private void FillValues()
        {
            var labelCount   = 0;
            var achievements = new ASFBankDecoder(Registry.Instance.BankFileOverride).GetAchievements();

            foreach (var control in Controls)
            {
                if (control is VLabel label && label.Name.StartsWith("label"))
                {
                    labelCount++;

                    var i = (label.Location.X - 110) / 50;
                    var j = (label.Location.Y - 40) / 20;

                    if (j % 2 == 0)
                    {
                        label.BackColor = System.Drawing.Color.FromArgb(210, 210, 210);
                    }

                    label.Text = achievements[j][i] ? "X" : string.Empty;
                }
            }

            if (labelCount != 270)
            {
                Debugger.Break();
            }
        }
Пример #2
0
        public static void CopyBankFile()
        {
            var bankFileDirectory = $"{ASFBankDecoder.GetDefaultBankFilePath()}";
            var backupDirectory   = string.IsNullOrEmpty(Registry.Instance.BankFileOverride)
                                ? $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}\\{DirectoryManager.ApplicationName}\\Backups\\{GetBackupName()}.SC2Bank"
                                : Registry.Instance.BankFileOverride;

            CopyFile(bankFileDirectory, backupDirectory);
        }
Пример #3
0
        public void TestGettingBankFile()
        {
            var decoder = new ASFBankDecoder(null);

            Assert.That(decoder.RankPoints, Is.InstanceOf(typeof(int)));
            Assert.That(decoder.Gems, Is.InstanceOf(typeof(int)));
            Assert.That(() => decoder.Key, Throws.Nothing);
            Assert.That(() => decoder.GetSoulString(9), Throws.Nothing);
            Assert.That(() => decoder.GetAchievements(), Throws.Nothing);
            Assert.That(() => decoder.AchievementCount, Is.InRange(1, 500));
            Assert.That(() => decoder.SoulCollection, Throws.Nothing);
            Assert.That(() => decoder.Challenges, Throws.Nothing);
        }
Пример #4
0
 public void TestGetString()
 {
     var decoder = new ASFBankDecoder(null);
     var x       = decoder.GetValue("0OO", "%?%?", 2);
     //Assert.That(x, Is.EqualTo(""));
 }