package dwarf.graphics;

import dwarf.util.Vector2;

/**
 * @author sid_th3_sl0th
 */
public class Quadrilateral extends Polygon {

    public Quadrilateral(Vector2[] points, Vector2 position, String state, Colour colour) {
        super(position, state, colour);

        if (points != null) {
            if (points.length != 4) {
                throw new IllegalArgumentException("lol you stupid idiot, quadrilaterals have 4 sides and thus are made up of 4 points.");
            } else {
                super.setPoints(points);
            }
        }
    }

    public Quadrilateral(Vector2 pointA, Vector2 pointB, Vector2 pointC, Vector2 pointD, Vector2 position, String state, Colour colour) {
        super(position, state, colour);

        Vector2[] points = {
            pointA, pointB, pointC, pointD
        };

        super.setPoints(points);
    }

    @Override
    public void addPoint(Vector2 point) {
        System.err.println("This method is unsuported with the Quadrilateral class.");
    }
}

@@ -50,16 +50,305 @@
 2;%0A%0A/**%0A
+ * In Euclidean plane geometry, a quadrilateral is a polygon with four sides (or%0A * edges) and four vertices or corners. Sometimes, the term quadrangle is used,%0A * by analogy with triangle, and sometimes tetragon for consistency with%0A * pentagon (5-sided), hexagon (6-sided) and so on.%0A *%0A
  * @auth

Update Quadrilateral.java