using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Drawing; namespace Paint_2 { internal class Sketch { List _toolList; PaintTool _currentTool; Color _currentColor; bool _isDrawing; Bitmap _drawing; Size _sketchSize; string _name; internal List ToolList { get => _toolList; set => _toolList = value; } public PaintTool CurrentTool { get => _currentTool; set => _currentTool = value; } public Color CurrentColor { get => _currentColor; set => _currentColor = value; } public bool IsDrawing { get => _isDrawing; set => _isDrawing = value; } public Bitmap Drawing { get => _drawing; set => _drawing = value; } public Size SketchSize { get => _sketchSize; set => _sketchSize = value; } public string Name { get => _name; set => _name = value; } public Sketch(Size sketchSize,List toolList) { CurrentColor = Color.FromArgb(0xFF, 0xFF, 0xFF); IsDrawing = false; Drawing = new Bitmap(sketchSize.Width, sketchSize.Height); ToolList = toolList; if (toolList[0] != null) { CurrentTool = toolList[0]; } else { CurrentTool = null; } } public Sketch(List toolList) : this(new Size(500, 500),toolList) { //empty } public void StartDrawing(Point location,Color color,int width) { CurrentTool.Start(location,color,width); } public void StopDrawing(Point location) { CurrentTool.Stop(location); } public void AddDrawingPoint(Point location) { CurrentTool.Add(location); } public void Paint() { foreach (PaintTool tool in ToolList) { tool.Paint(Drawing); } } public Color GetColor(Point location) { //Todo return Color.FromArgb(0x34,0xF4,0xFF); } } }