コード例 #1
0
        public void TrySetDirtyShouldReturnFalseAfterFirstCall()
        {
            var dirtyTracker = new EntityDirtyTracker();

            dirtyTracker.TrySetDirty(ComponentMap<ISimpleComponent>.Accessor).ShouldBeTrue();
            dirtyTracker.TrySetDirty(ComponentMap<ISimpleComponent>.Accessor).ShouldBeFalse();
            dirtyTracker.TrySetDirty(ComponentMap<ISimpleComponent>.Accessor).ShouldBeFalse();
        }
コード例 #2
0
        public void TestResetSingleComponent()
        {
            var dirtyTracker = new EntityDirtyTracker();

            dirtyTracker.TrySetDirty(ComponentMap<ISimpleComponent>.Accessor).ShouldBeTrue();
            dirtyTracker.TrySetDirty(ComponentMap<ISimpleComponent>.Accessor).ShouldBeFalse();

            dirtyTracker.Reset(ComponentMap<ISimpleComponent>.Accessor);

            dirtyTracker.TrySetDirty(ComponentMap<ISimpleComponent>.Accessor).ShouldBeTrue();
        }