示例#1
0
 void SubmitCreatingNodes()
 {
     GraphEditManager.BeforePreformEdit(Graph, "Create Graph Elements");
     GraphManipulation.AddShape(Graph, CreatingNodes);
     ExitCreatingMode();
     EnterCreatingMode();
 }
示例#2
0
 internal void ClearSelectedDecorations()
 {
     GraphEditManager.BeforePreformEdit(Graph, "Clear Decorations");
     foreach (GraphElement element in SelectedObjects)
     {
         element.Decorator = null;
     }
 }
示例#3
0
        internal void TetrisTemplateClick(int x, int y, MouseButtons button)
        {
            int tetrisTemplatePosition = QueryTetrisTemplatePosition(new Vector(x, y).MapFromScreen(TetrisTemplateScale, TetrisTemplateOrigin));

            if (tetrisTemplatePosition >= 0)
            {
                SelectedTetrisShapes[tetrisTemplatePosition] = !SelectedTetrisShapes[tetrisTemplatePosition];
                if (SelectedObjects.Count > 0)
                {
                    GraphEditManager.BeforePreformEdit(Graph, "Tetris Decorator");
                    TemplateViewToTetrisIndex(SelectedObjects[0].Decorator);
                }
                else if (PasteMode)
                {
                    TemplateViewToTetrisIndex(SampleDecorator);
                }
            }
        }
示例#4
0
 internal bool CombineDecorators(Decorator decorator, GraphElement graphElement)
 {
     if (graphElement.Decorator == null || decorator == null)
     {
         return(false);
     }
     PuzzleGraph.Decorators.CombinedDecorator combinedDecorator = new PuzzleGraph.Decorators.CombinedDecorator();
     combinedDecorator.Second = decorator.Clone() as Decorator;
     combinedDecorator.First  = graphElement.Decorator.Clone() as Decorator;
     if (combinedDecorator.IsDecorableFor(graphElement))
     {
         GraphEditManager.BeforePreformEdit(Graph, "Combine Decorators");
         graphElement.Decorator = combinedDecorator;
         return(true);
     }
     else
     {
         return(false);
     }
 }