public void doEventWithPriorTrigTest()
        {
            SyncTriggerSystem system = createSystem();
            int i = 0;

            system.regTrigBfr("TestEvent", new SyncTrigger(game =>
            {
                return(1);
            }, game =>
            {
                if (i == 1)
                {
                    i = 2;
                }
            }));
            system.regTrigBfr("TestEvent", new SyncTrigger(game =>
            {
                return(2);
            }, game =>
            {
                if (i == 0)
                {
                    i = 1;
                }
            }));
            system.doEvent(new EventContext("TestEvent"), game =>
            {
                if (i == 2)
                {
                    i = 3;
                }
            });
            Assert.AreEqual(3, i);
        }
        public void doEventWithTriggerTest()
        {
            SyncTriggerSystem system = createSystem();
            int a = 0, b = 0;

            system.regTrigBfr("TestEvent", new SyncTrigger(game =>
            {
                return(game.trigger.currentTask.context.hasVar("b"));
            }, game =>
            {
                b = game.trigger.currentTask.context.getVar <int>("b");
            }));
            system.regTrigAft("TestEvent", new SyncTrigger(game =>
            {
                return(game.trigger.currentTask.context.hasVar("a"));
            }, game =>
            {
                a = game.trigger.currentTask.context.getVar <int>("a");
            }));
            system.doEvent(new EventContext("TestEvent")
            {
                { "a", 1 },
                { "b", 2 }
            });

            Assert.AreEqual(2, b);
            Assert.AreEqual(1, a);
        }
        public void regGetUnregTest()
        {
            SyncTriggerSystem system = createSystem();

            Assert.AreEqual(0, system.getTrigBfr("Test").Count());
            Assert.AreEqual(0, system.getTrigAft("Test").Count());
            SyncTrigger t1 = new SyncTrigger();
            SyncTrigger t2 = new SyncTrigger();

            system.regTrigBfr("Test", t1);
            system.regTrigAft("Test", t2);
            Assert.AreEqual(1, system.getTrigBfr("Test").Count());
            Assert.AreEqual(t1, system.getTrigBfr("Test").First());
            Assert.AreEqual(1, system.getTrigAft("Test").Count());
            Assert.AreEqual(t2, system.getTrigAft("Test").First());
            system.unregTrigBfr("Test", t1);
            system.unregTrigAft("Test", t2);
            Assert.AreEqual(0, system.getTrigBfr("Test").Count());
            Assert.AreEqual(0, system.getTrigAft("Test").Count());
        }