public void DrawHouse(House obj) { if (_drawLibX != null) { _drawLibX.DrawTriangle(obj.Roof); _drawLibX.DrawRectangle(obj.Body); return; } if (_drawLibY != null) { // All this for drawing a rectangle... double brX = obj.Body.BotRight.X; double brY = obj.Body.BotRight.Y; double tlX = obj.Body.TopLeft.X; double tlY = obj.Body.TopLeft.Y; _drawLibY.DrawLine(tlX, tlY, brX, tlY); _drawLibY.DrawLine(brX, tlY, brX, brY); _drawLibY.DrawLine(brX, brY, tlX, brY); _drawLibY.DrawLine(tlX, brY, tlX, tlY); // All this for drawing a triangle... double aX = obj.Roof.A.X; double aY = obj.Roof.A.Y; double bX = obj.Roof.B.X; double bY = obj.Roof.B.Y; double cX = obj.Roof.C.X; double cY = obj.Roof.C.Y; _drawLibY.DrawLine(aX, aY, bX, bY); _drawLibY.DrawLine(bX, bY, cX, cY); _drawLibY.DrawLine(cX, cY, aX, aY); return; } }
public void DrawTriangle(Triangle obj) { _drawLibX.DrawTriangle(obj); }