38 lines
2.2 KiB
C#
38 lines
2.2 KiB
C#
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
using System.Numerics;
|
||
|
|
||
|
namespace Quik
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// QUIK draw command provider.
|
||
|
/// </summary>
|
||
|
public class QuikDraw
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// The draw command queue.
|
||
|
/// </summary>
|
||
|
private Queue<QuikCommand> Commands { get; } = new Queue<QuikCommand>();
|
||
|
|
||
|
public void Mask(QuikRectangle bounds) => Commands.Enqueue(new QuikCommandMask(bounds));
|
||
|
public void Line(QuikLine line) => Commands.Enqueue(new QuikCommandLine(line));
|
||
|
public void Line(params QuikLine[] lines) => Commands.Enqueue(new QuikCommandLines(lines));
|
||
|
public void Line(IEnumerable<QuikLine> lines) => Commands.Enqueue(new QuikCommandLines(lines.ToArray()));
|
||
|
public void Bezier(params QuikBezier[] curve) => Commands.Enqueue(new QuikCommandBezier(curve));
|
||
|
public void Bezier(IEnumerable<QuikBezier> curve) => Commands.Enqueue(new QuikCommandBezier(curve.ToArray()));
|
||
|
public void Rectangle(QuikRectangle rectangle) => Commands.Enqueue(new QuikCommandRectangle(rectangle));
|
||
|
public void Rectangle(params QuikRectangle[] rectangles) =>
|
||
|
Commands.Enqueue(new QuikCommandRectangles(rectangles));
|
||
|
public void Rectangle(IEnumerable<QuikRectangle> rectangles) =>
|
||
|
Commands.Enqueue(new QuikCommandRectangles(rectangles.ToArray()));
|
||
|
public void Triangle(QuikTriangle triangle) => Commands.Enqueue(new QuikCommandTriangle(triangle));
|
||
|
public void Triangle(params QuikTriangle[] triangles) => Commands.Enqueue(new QuikCommandTriangles(triangles));
|
||
|
public void Triangle(IEnumerable<QuikTriangle> triangles) =>
|
||
|
Commands.Enqueue(new QuikCommandTriangles(triangles.ToArray()));
|
||
|
public void Polygon(params Vector2[] polygon) => Commands.Enqueue(new QuikCommandPolygon(polygon));
|
||
|
public void Polygon(IEnumerable<Vector2> polygon) => Commands.Enqueue(new QuikCommandPolygon(polygon.ToArray()));
|
||
|
public void StencilClear() => Commands.Enqueue(new QuikCommandStencilClear());
|
||
|
public void StencilBegin() => Commands.Enqueue(new QuikCommandStencilBegin());
|
||
|
public void StencilEnd() => Commands.Enqueue(new QuikCommandStencilEnd());
|
||
|
}
|
||
|
}
|