public void ShouldIgnoreEverythingExceptSceneAndSubScenes()
        {
            EntityHierarchyState.OnFoldingStateChanged(EntityHierarchyNodeId.Root, true);
            EntityHierarchyState.OnFoldingStateChanged(EntityHierarchyNodeId.FromEntity(new Entity {
                Index = 1, Version = 1
            }), true);
            EntityHierarchyState.OnFoldingStateChanged(EntityHierarchyNodeId.FromScene(1), true);
            EntityHierarchyState.OnFoldingStateChanged(EntityHierarchyNodeId.FromSubScene(1), false);

            Assert.That(EntityHierarchyState.GetFoldingState(EntityHierarchyNodeId.Root), Is.Null);
            Assert.That(EntityHierarchyState.GetFoldingState(EntityHierarchyNodeId.FromEntity(new Entity {
                Index = 1, Version = 1
            })), Is.Null);
            Assert.That(EntityHierarchyState.GetFoldingState(EntityHierarchyNodeId.FromScene(1)), Is.True);
            Assert.That(EntityHierarchyState.GetFoldingState(EntityHierarchyNodeId.FromSubScene(1)), Is.False);
        }
        // Creates the basic hierarchy for a single scene with a single subscene.
        static (TestHierarchy.TestNode root, TestHierarchy.TestNode subScene, int nextSceneId, int nextEntityId) CreateBaseHierarchyForSubscene()
        {
            var entityId = 0;
            var sceneId  = 0;

            var rootNode = TestHierarchy.CreateRoot();

            rootNode.AddChildren(
                new EntityHierarchyNodeId(NodeKind.Entity, entityId++, 0),                                  // World Time Entity
                new EntityHierarchyNodeId(NodeKind.Entity, entityId++, 0),                                  // SubScene Entity
                new EntityHierarchyNodeId(NodeKind.Entity, entityId++, 0));                                 // SceneSection Entity

            var subSceneNode =
                rootNode.AddChild(EntityHierarchyNodeId.FromScene(sceneId++))                  // Main Scene
                .AddChild(EntityHierarchyNodeId.FromSubScene(sceneId++));                      // SubScene

            return(rootNode, subSceneNode, sceneId, entityId);
        }
Example #3
0
        public void ShouldIgnoreEverythingExceptSceneAndSubScenes()
        {
            var state = new EntityHierarchyFoldingState(Guid.NewGuid().ToString("N"));

            state.OnFoldingStateChanged(EntityHierarchyNodeId.Root, true);
            state.OnFoldingStateChanged(EntityHierarchyNodeId.FromEntity(new Entity {
                Index = 1, Version = 1
            }), true);
            state.OnFoldingStateChanged(EntityHierarchyNodeId.FromScene(1), true);
            state.OnFoldingStateChanged(EntityHierarchyNodeId.FromSubScene(1), false);

            Assert.That(state.GetFoldingState(EntityHierarchyNodeId.Root), Is.Null);
            Assert.That(state.GetFoldingState(EntityHierarchyNodeId.FromEntity(new Entity {
                Index = 1, Version = 1
            })), Is.Null);
            Assert.That(state.GetFoldingState(EntityHierarchyNodeId.FromScene(1)), Is.True);
            Assert.That(state.GetFoldingState(EntityHierarchyNodeId.FromSubScene(1)), Is.False);
        }