
// Shape.java
// Andrew Davison, Jan 2023, ad@coe.psu.ac.th

/* Abstract shape class. Concrete classes are created by
   defining the draw() method. 

   This class corresponds to the Shape class in the 
   Java SimplePaint application.
*/ 

package com.mygdx.game;


// import java.awt.*;
import com.badlogic.gdx.graphics.*;
import com.badlogic.gdx.math.*;    // Point --> Vector2

import com.badlogic.gdx.graphics.glutils.*;



public abstract class Shape 
{
  protected boolean isFilled;   // is the shape filled with color?
  protected Color shapeColor;

  protected Vector2 startPt, endPt;   // the two points used for the shape
  

  public Shape(float x1, float y1, float x2, float y2,
	            boolean isFilled, Color color) 
  {
    startPt = new Vector2(x1,y1);
    endPt = new Vector2(x2,y2);
    this.isFilled = isFilled;
    shapeColor = new Color(color);  // make a copy
  } // end of Shape()


  public void adjustShape(float x1, float y1, float x2, float y2) 
  {
    startPt.x = x1; startPt.y = y1;
    endPt.x = x2; endPt.y = y2;
  }
  
  
  public abstract void drawShape(ShapeRenderer sr);
  // draws the shape on the screen
  
} // end of Shape class
