Пример #1
0
        SceneNode CreateSceneNode(int idValue)
        {
            SceneNode node = new SceneNode();

            node.SetIdentifier(idValue);
            store.Add(node);
            SimulationScene wrapper = new SimulationScene(this, node);

            return(node);
        }
Пример #2
0
        public bool GetScene(int routeID, out SimulationScene scene)
        {
            SceneNode sNode;

            if (GetNode(routeID, out sNode))
            {
                scene = sNode.Wrapper;
                return(true);
            }
            else
            {
                scene = null;
                return(false);
            }
        }
Пример #3
0
        private bool GetParentFromChildren(out SimulationScene parent)
        {
            List <int> rawRoutes = wrappedScene.GetRoutes();

            parent = null;

            // Iterate over all child route IDs
            foreach (int route in rawRoutes)
            {
                bool flag = false;

                // Get the decision node from the route ID
                SimulationScene decision;
                if (GetSceneFromRoute(route, out decision))
                {
                    // Iterate over the routes in the child to check if this node is contained within it (a loop-back case)
                    List <int> pRawRoutes = decision.wrappedScene.GetRoutes();
                    foreach (int pRoute in pRawRoutes)
                    {
                        // Get the child node
                        SimulationScene pDecision;
                        if (GetSceneFromRoute(pRoute, out pDecision))
                        {
                            // Is this node equal to self?
                            if (pDecision.Identifier == Identifier)
                            {
                                flag = true;
                                break;
                            }
                        }
                    }

                    // Was the self-node found in the decision?
                    if (flag)
                    {
                        parent = decision;
                        break;
                    }
                }
            }

            return(parent != null);
        }
Пример #4
0
 public void SetWrapper(SimulationScene wrapper)
 {
     this.wrapper = wrapper;
 }
Пример #5
0
 public bool GetSceneFromRoute(int route, out SimulationScene scene)
 {
     return(sceneController.GetScene(route, out scene));
 }