\r
namespace Psychlops{\r
\r
- public interface Shape : Figure\r
+ public interface Shape : Internal.PrimitiveFigure\r
{\r
- void draw(Color c);\r
Color fill { get; set; }\r
Stroke stroke { get; set; }\r
}\r
public static class ShapeExtention\r
{\r
- /*\r
- public static void draw(this Shape drawee)\r
+ public static void draw(this Shape drawee, Color c)\r
{\r
- drawee.draw(Color.white);\r
+ Color tmp_col = drawee.fill;\r
+ Stroke tmp_strk = drawee.stroke;\r
+ drawee.fill = c;\r
+ drawee.stroke = new Stroke();\r
+ drawee.draw();\r
+ drawee.fill = tmp_col;\r
+ drawee.stroke = tmp_strk;\r
+ }\r
+ public static void draw(this Shape drawee, Stroke strk)\r
+ {\r
+ Color tmp_col = drawee.fill;\r
+ Stroke tmp_strk = drawee.stroke;\r
+ drawee.fill = new Color(0,0,1,1);\r
+ drawee.stroke = strk;\r
+ drawee.draw();\r
+ drawee.fill = tmp_col;\r
+ drawee.stroke = tmp_strk;\r
}\r
- */\r
}\r
\r
public partial struct Stroke\r
{\r
public double thick;\r
public Color color;\r
+ public Stroke(Color c, double t)\r
+ {\r
+ color = c;\r
+ thick = t;\r
+ }\r
public void set(Color c, double t)\r
{\r
color = c;\r
return this;\r
}\r
\r
- public void draw(Color c)\r
- {\r
- Main.drawable.line(this, c);\r
- }\r
public void draw()\r
{\r
Main.drawable.line(this);\r
return this;\r
}\r
\r
- public void draw(Color c)\r
- {\r
- Main.drawable.rect(this, c);\r
- }\r
public void draw()\r
{\r
Main.drawable.rect(this);\r
public Color fill { get; set; }\r
public Stroke stroke { get; set; }\r
\r
+ public override string ToString()\r
+ {\r
+ return "Left:" + left.ToString() + " Top:" + top.ToString() + " Right:" + right.ToString() + " Bottom:" + bottom.ToString();\r
+ }\r
}\r
\r
\r
return this;\r
}\r
\r
- public void draw(Color c)\r
- {\r
- Main.drawable.ellipse(this, c);\r
- }\r
public void draw()\r
{\r
Main.drawable.ellipse(this);\r
return this;\r
}\r
\r
- public void draw(Color c)\r
- {\r
- Main.drawable.polygon(this, c);\r
- }\r
public void draw()\r
{\r
Main.drawable.polygon(this);\r