コード例 #1
0
        public void General_TeamName_Write()
        {
            var save    = GetTestSave();
            var newSave = new SkySave(save.ToByteArray());

            Assert.AreEqual("Blue", newSave.TeamName);
        }
コード例 #2
0
        public void General_Adventures_Write()
        {
            var save    = GetTestSave();
            var newSave = new SkySave(save.ToByteArray());

            Assert.AreEqual(128, newSave.NumberOfAdventures);
        }
コード例 #3
0
        public void OriginalPartnerName_Write()
        {
            var save    = GetTestSave();
            var newSave = new SkySave(save.ToByteArray());

            Assert.AreEqual("Piplup", newSave.OriginalPartnerName);
        }
コード例 #4
0
        public void WindowFrameType_Write()
        {
            var save    = GetTestSave();
            var newSave = new SkySave(save.ToByteArray());

            Assert.AreEqual(5, save.WindowFrameType);
        }
コード例 #5
0
        public void General_SpEpisodeHeldMoney_Write()
        {
            var save    = GetTestSave();
            var newSave = new SkySave(save.ToByteArray());

            Assert.AreEqual(0, newSave.SpEpisodeHeldMoney);
        }
コード例 #6
0
        public void General_StoredMoney_Write()
        {
            var save    = GetTestSave();
            var newSave = new SkySave(save.ToByteArray());

            Assert.AreEqual(44459, newSave.StoredMoney);
        }
コード例 #7
0
        public void General_ExplorersRankPoints_Write()
        {
            var save    = GetTestSave();
            var newSave = new SkySave(save.ToByteArray());

            Assert.AreEqual(3820, newSave.ExplorerRankPoints);
        }
コード例 #8
0
        public void OriginalPartnerPokemon_Write()
        {
            var save    = GetTestSave();
            var newSave = new SkySave(save.ToByteArray());

            Assert.AreEqual(428, newSave.OriginalPartnerPokemon.ID);
            Assert.IsFalse(newSave.OriginalPartnerPokemon.IsFemale);
        }
コード例 #9
0
        public void ActivePokemon_Write()
        {
            var save    = GetTestSave();
            var newSave = new SkySave(save.ToByteArray());

            TestActivePokemon(newSave);

            // Ensure raw data is equal
            for (int i = 0; i < save.ActivePokemon.Count; i++)
            {
                Assert.IsTrue(save.ActivePokemon[i].GetActivePokemonBits().Bits.SequenceEqual(newSave.ActivePokemon[i].GetActivePokemonBits().Bits));
            }
        }
コード例 #10
0
        public void HeldItems_Write()
        {
            var save    = GetTestSave();
            var newSave = new SkySave(save.ToByteArray());

            TestHeldItems(newSave);

            // Test raw data
            for (int i = 0; i < save.HeldItems.Count; i++)
            {
                Assert.AreEqual(save.HeldItems[i], newSave.HeldItems[i]);
            }
        }
コード例 #11
0
        private void TestActivePokemon(SkySave save)
        {
            Assert.AreEqual(2, save.ActivePokemon.Count);

            // Player
            Assert.AreEqual(490, save.ActivePokemon[0].ID.ID);
            Assert.AreEqual(false, save.ActivePokemon[0].ID.IsFemale);
            Assert.AreEqual(60, save.ActivePokemon[0].Level);
            Assert.AreEqual("Evan", save.ActivePokemon[0].Name);

            // Partner
            Assert.AreEqual(430, save.ActivePokemon[1].ID.ID);
            Assert.AreEqual(false, save.ActivePokemon[1].ID.IsFemale);
            Assert.AreEqual(59, save.ActivePokemon[1].Level);
            Assert.AreEqual("Empoleon", save.ActivePokemon[1].Name);
        }
コード例 #12
0
        private void TestHeldItems(SkySave save)
        {
            Assert.AreEqual(12, save.HeldItems.Count);
            TestHeldItem(save.HeldItems[0], 131, 0, 1, false, false, false, 0);   // Gray Gummi
            TestHeldItem(save.HeldItems[1], 128, 0, 1, false, false, false, 0);   // Sky Gummi
            TestHeldItem(save.HeldItems[2], 123, 0, 1, false, false, false, 0);   // Yellow Gummi
            TestHeldItem(save.HeldItems[3], 90, 0, 1, false, false, false, 0);    // Chesto Berry
            TestHeldItem(save.HeldItems[4], 69, 0, 1, false, false, false, 0);    // Heal Seed
            TestHeldItem(save.HeldItems[5], 83, 0, 1, false, false, false, 0);    // Totter Seed
            TestHeldItem(save.HeldItems[6], 86, 0, 1, false, false, false, 0);    // Warp Seed
            TestHeldItem(save.HeldItems[7], 86, 0, 1, false, false, false, 0);    // Warp Seed

            TestHeldItem(save.HeldItems[8], 187, 215, 1, false, true, false, 0);  // Used TM (Dig)
            TestHeldItem(save.HeldItems[9], 309, 0, 1, false, false, false, 0);   // Mug Orb
            TestHeldItem(save.HeldItems[10], 84, 0, 1, false, false, false, 0);   // Sleep Seed
            TestHeldItem(save.HeldItems[11], 373, 132, 1, true, false, false, 0); // Nifty Box (Purple Gummi)
        }
コード例 #13
0
        private void TestStoredItems(SkySave save)
        {
            Assert.AreEqual(321, save.StoredItems.Count);

            // Page 1
            TestItem(save.StoredItems[0], 37, 0, 1, false, false, false); // Def scarf
            TestItem(save.StoredItems[1], 37, 0, 1, false, false, false); // Def Scarf
            TestItem(save.StoredItems[2], 37, 0, 1, false, false, false); // Def Scarf
            TestItem(save.StoredItems[3], 37, 0, 1, false, false, false); // Def Scarf
            TestItem(save.StoredItems[4], 16, 0, 1, false, false, false); // Mobile Scarf
            TestItem(save.StoredItems[5], 51, 0, 1, false, false, false); // Pass Scarf
            TestItem(save.StoredItems[6], 27, 0, 1, false, false, false); // Pecha Scarf
            TestItem(save.StoredItems[7], 27, 0, 1, false, false, false); // Pecha Scarf

            // Page 2
            TestItem(save.StoredItems[8], 27, 0, 1, false, false, false);   // Pecha Scarf
            TestItem(save.StoredItems[9], 27, 0, 1, false, false, false);   // Pecha Scarf
            TestItem(save.StoredItems[10], 31, 0, 1, false, false, false);  // Sneak Scarf
            TestItem(save.StoredItems[11], 17, 0, 1, false, false, false);  // Heal Ribbon
            TestItem(save.StoredItems[12], 23, 0, 1, false, false, false);  // Joy Ribbon
            TestItem(save.StoredItems[13], 23, 0, 1, false, false, false);  // Joy Ribbon
            TestItem(save.StoredItems[14], 436, 0, 1, false, false, false); // Viridian Bow
            TestItem(save.StoredItems[15], 25, 0, 1, false, false, false);  // Persim Band

            // ...

            // Page 4
            // ...
            TestItem(save.StoredItems[31], 2, 0, 8, false, false, true); // Iron Thorn (8)

            // Page 5
            // ...
            TestItem(save.StoredItems[33], 7, 0, 20, false, false, true); // Gravelrock (20)

            // ...

            // Page 41
            TestItem(save.StoredItems[320], 714, 0, 1, false, false, false); // Grotle Twig
        }