Esempio n. 1
0
        public void StatAchievement_NotCompleted()
        {
            var achievement = new StatMAchievementTest(2);

            MEvents.RaiseEvent(new TestEvent(1));

            Assert.IsFalse(achievement.IsCompleted);
        }
Esempio n. 2
0
        public void StatAchievement_PartCompleted()
        {
            var achievement = new StatMAchievementTest(2);

            MEvents.RaiseEvent(new TestEvent(1));

            Assert.IsTrue(Math.Abs(achievement.Progress - 0.5f) < 0.0001f);
        }
Esempio n. 3
0
        public void StatAchievement_CompleteCorrect()
        {
            var achievement = new StatMAchievementTest(1);

            MEvents.RaiseEvent(new TestEvent(1));

            Assert.IsTrue(achievement.IsCompleted);
        }
Esempio n. 4
0
        public void CompositeAchievement_CompletesFor1Objective()
        {
            var objective   = new StatMAchievementTest(1);
            var achievement = new MCompositeAchievement("", objective);

            MEvents.RaiseEvent(new TestEvent(1));

            Assert.IsTrue(achievement.IsCompleted);
        }
Esempio n. 5
0
        public void CompositeAchievement_PartialCompletion()
        {
            var objective1 = new StatMAchievementTest(1);
            var objective2 = new StatMAchievementTest(2);

            var achievement = new MCompositeAchievement("", objective1, objective2);

            MEvents.RaiseEvent(new TestEvent(1));

            Assert.IsTrue(Math.Abs(achievement.Progress - 0.5f) < 0.0001f);
        }
Esempio n. 6
0
        public void RemovingEventListener()
        {
            MEvents.Add <TestEvent>(TestEventListener);

            MEvents.RaiseEvent(new TestEvent(1));
            LogAssert.Expect(LogType.Log, "TestEvent" + 1);

            MEvents.Remove <TestEvent>(TestEventListener);
            MEvents.RaiseEvent(new TestEvent(1));

            LogAssert.NoUnexpectedReceived();
        }
Esempio n. 7
0
        public bool TryUpgradeCapacity()
        {
            if (Level >= _capacity.Count - 1)
            {
                MEvents.RaiseEvent(new UpgradableCurrencyUpgradeFailedEvent(this));
                return(false);
            }

            Level++;
            MEvents.RaiseEvent(new UpgradableCurrencyUpgradeSuccessEvent(this));
            return(true);
        }
Esempio n. 8
0
        public void CompositeAchievement_NestedCompletion()
        {
            var objective1 = new StatMAchievementTest(1);
            var objective2 = new StatMAchievementTest(2);
            var objective3 = new MCompositeAchievement("", objective1, objective2);
            var objective4 = new StatMAchievementTest(3);

            var achievement = new MCompositeAchievement("", objective3, objective4);

            MEvents.RaiseEvent(new TestEvent(3));

            Assert.IsTrue(achievement.IsCompleted);
        }
Esempio n. 9
0
 public void RaisingEvent()
 {
     MEvents.Add <TestEvent>(TestEventListener);
     MEvents.RaiseEvent(new TestEvent(0));
     LogAssert.Expect(LogType.Log, "TestEvent0");
 }