void SubmitCreatingNodes() { GraphEditManager.BeforePreformEdit(Graph, "Create Graph Elements"); GraphManipulation.AddShape(Graph, CreatingNodes); ExitCreatingMode(); EnterCreatingMode(); }
internal void ClearSelectedDecorations() { GraphEditManager.BeforePreformEdit(Graph, "Clear Decorations"); foreach (GraphElement element in SelectedObjects) { element.Decorator = null; } }
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); } } }
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); } }