예제 #1
0
 public GnosisContainerController(
     IGnosisContainerImplementation _container,
     // IGnosisContainerImplementation _containerImplementation,
     GnosisEntityController entityController,
     GnosisVisibleController parent)
     : base(_container, entityController, parent)
 {
     // _containerImplementation.SetOrder(_container.Order);
 }
예제 #2
0
        public void AddChildModel(IGnosisContainerImplementation childModel)
        {
            if (childModel is GnosisSplit)
            {
                // IGnosisSplitImplementation splitImplementation = GlobalData.Singleton.ImplementationCreator.GetGnosisSplitImplementation();
                GnosisSplitController splitController = new GnosisSplitController((GnosisSplit)childModel, EntityController, this);
                splitController.Setup();

                AddChildController(splitController);
            }
            else if (childModel is GnosisTile)
            {
                // IGnosisTileImplemenation tileImplementation = GlobalData.Singleton.ImplementationCreator.GetGnosisTileImplementation();
                GnosisTileController tileController = new GnosisTileController((GnosisTile)childModel, EntityController, this);

                AddChildController(tileController);
            }
            ((GnosisContainer)childModel).PropertyChanged += ChildContainer_PropertyChanged;
        }
예제 #3
0
        public GnosisSplit FindParent(IGnosisContainerImplementation child, GnosisSplit currentNode)
        {
            GnosisSplit parent = null;

            if (currentNode.Splits != null)
            {
                while (parent == null)
                {
                    foreach (GnosisSplit split in currentNode.Splits)
                    {
                        if (split == child)
                        {
                            parent = currentNode;
                        }
                        else
                        {
                            parent = FindParent(child, split);
                        }
                    }
                    break;
                }
            }
            else
            {
                foreach (GnosisTile tile in currentNode.Tiles)
                {
                    if (tile == child)
                    {
                        parent = currentNode;
                        break;
                    }
                }
            }

            return(parent);
        }