-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTool.cs
More file actions
47 lines (38 loc) · 929 Bytes
/
Copy pathTool.cs
File metadata and controls
47 lines (38 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using SplashKitSDK;
public abstract class ShapeTool
{
protected double _x, _y;
protected Color _color;
public ShapeTool(double x, double y, Color color)
{
_x = x;
_y = y;
_color = color;
}
public abstract void Draw();
}
public class CircleTool : ShapeTool
{
private double _radius;
public CircleTool(double x, double y, double radius, Color color) : base(x, y, color)
{
_radius = radius;
}
public override void Draw()
{
SplashKit.FillCircle(_color, _x, _y, _radius);
}
}
public class RectangleTool : ShapeTool
{
private double _width, _height;
public RectangleTool(double x, double y, double width, double height, Color color) : base(x, y, color)
{
_width = width;
_height = height;
}
public override void Draw()
{
SplashKit.FillRectangle(_color, _x, _y, _width, _height);
}
}