예제 #1
0
        public void TestBitCodeNotEqual()
        {
            var center = new BitCodeCenter();
            var c1     = center.GetBitCodeByType(typeof(AClass));
            var c2     = center.GetBitCodeByString("AClass");

            Assert.AreNotEqual(c1, c2);
        }
예제 #2
0
        public void TestBitCodeEqual()
        {
            var center = new BitCodeCenter();
            var c1     = center.GetBitCodeByType(typeof(AClass));
            var c2     = center.GetBitCodeByString("Pioneer.Test.Bit.BitCodeCenterTests+AClass");

            Assert.AreEqual(c1, c2);
        }
예제 #3
0
        public override void Dispose()
        {
            Reset();

            // NOTE: Dispose System first since system dispose logic may
            // need Actor
            for (var i = 0; i < this.systems.Count; ++i)
            {
                this.systems[i].Dispose();
            }

            // NOTE: DONOT dispose trait in traitPool since they have been
            // disposed already when being dropped
            var node = this.actors.First;

            while (null != node)
            {
                (node.Value as Actor).DisposeImmediate();
                node = node.Next;
            }

            while (this.actorPool.Count > 0)
            {
                var e = this.actorPool.Pop() as Actor;
                e.DisposeImmediate();
            }

            this.filters.Dispose();
            this.center.Dispose();

            this.socket      = null;
            this.actors      = null;
            this.actorMap    = null;
            this.filters     = null;
            this.cycleActors = null;
            this.actorPool   = null;
            this.center      = null;
            this.traitPool   = null;
            this.actors      = null;
            this.systems     = null;

            base.Dispose();
        }