Example #1
0
    public IEnumerator JSONWriteTest()
    {
        UpgradeSystem upgradeSystem = new UpgradeSystem();
        Upgrade       testUpgrade   = new Upgrade("Bomb Count", 1);

        upgradeSystem.AddUpgrade(testUpgrade);
        testUpgrade = new Upgrade("Speed", 2);
        upgradeSystem.AddUpgrade(testUpgrade);
        testUpgrade = new Upgrade("Range", 5);
        upgradeSystem.AddUpgrade(testUpgrade);
        UpgradeSystem.SaveUpgrades(upgradeSystem.GetUpgradeList());
        yield return(null);
    }
Example #2
0
        public IEnumerator UpgradeObjectRetrievalTest()
        {
            UpgradeSystem upgradeSystem = new UpgradeSystem();
            Upgrade       testUpgrade   = new Upgrade("Attack", 1);

            upgradeSystem.AddUpgrade(testUpgrade);
            Upgrade testUpgrade2 = upgradeSystem.GetUpgrade("Attack");

            Assert.AreEqual("Attack", testUpgrade2.GetUpgradeName());
            yield return(null);
        }
Example #3
0
        public IEnumerator UpgradeSystemObjectCreationTest()
        {
            UpgradeSystem upgradeSystem = new UpgradeSystem();
            int           listCount     = upgradeSystem.GetUpgradeCount();

            Assert.AreEqual(listCount, 0);
            Upgrade testUpgrade = new Upgrade("Attack", 1);

            upgradeSystem.AddUpgrade(testUpgrade);
            listCount = upgradeSystem.GetUpgradeCount();
            Assert.AreEqual(listCount, 1);
            yield return(null);
        }
Example #4
0
        public IEnumerator JSONWriteTest()
        {
            UpgradeSystem upgradeSystem = new UpgradeSystem();
            Upgrade       testUpgrade   = new Upgrade("Attack", 1);

            upgradeSystem.AddUpgrade(testUpgrade);

            /*testUpgrade = new Upgrade("Speed", 2);
            *  upgradeSystem.AddUpgrade(testUpgrade);
            *  testUpgrade = new Upgrade("Range", 5);
            *  upgradeSystem.AddUpgrade(testUpgrade);*/
            upgradeSystem.SaveUpgrades();
            yield return(null);
        }
Example #5
0
        public IEnumerator UpgradeLevelTest()
        {
            UpgradeSystem upgradeSystem = new UpgradeSystem();
            Upgrade       testUpgrade   = new Upgrade("Attack", 1);

            upgradeSystem.AddUpgrade(testUpgrade);
            int upgradeLevel = upgradeSystem.GetUpgrade("Attack").GetUpgradeLevel();

            upgradeSystem.GetUpgrade("Attack").IncreaseLevel();
            Assert.AreNotEqual(upgradeLevel, upgradeSystem.GetUpgrade("Attack").GetUpgradeLevel());
            upgradeLevel = upgradeSystem.GetUpgrade("Attack").GetUpgradeLevel();
            upgradeSystem.GetUpgrade("Attack").SetLevel(0);
            Assert.AreNotEqual(upgradeLevel, upgradeSystem.GetUpgrade("Attack").GetUpgradeLevel());
            yield return(null);
        }