private void onDragEnd(Point start, Point end) { switch (selectedTool) { case ToolType.Selector: break; case ToolType.Start: startPortal = new StartPortal(end); break; case ToolType.Goal: goalPortal = new GoalPortal(end); break; case ToolType.Obstacle: objects.Add(new Obstacle(start, end, true)); break; case ToolType.InvisibleObstacle: objects.Add(new Obstacle(start, end, false)); break; case ToolType.Attractor: units.Add(new Attractor(end)); break; case ToolType.Tracer: units.Add(new Tracer(end)); break; } using (Graphics g = Graphics.FromImage(previewLayer)) { g.Clear(ColorFromArgb(0x00ffffff)); } stageView.Refresh(); }
private void onDragBegin(Point start) { switch (selectedTool) { case ToolType.Start: startPortal = null; break; case ToolType.Goal: goalPortal = null; break; } }