import javax.swing.*;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Dimension;

/**
 *  Game Object Class
 *  <p>
 *  Reffers to every object related directly with the game, on the board
 *  Including Board Pannels, Pieces and Player Menus
 */
public abstract class GameObject  implements Comparable<GameObject>{
   private final int myId; /* to identify each element within its category */
   public int depth;
   public int level;

   protected GameObject( int id){
      myId = id;
   }
   protected int getId() {
      return myId;
   }
   public abstract Vector2D getPosition();
   public abstract void setPosition(Vector2D newpos);
   public abstract int getColumn();
   public abstract int getRow();
   public abstract int getDepth();
   public abstract void paintView(Graphics2D v);

   /**
     *  Method to compare game objects by depth
     */
   @Override
   public int compareTo(GameObject compareDepth) {
 
      int compareQuantity = ((GameObject) compareDepth).getDepth(); 
 
      //ascending order
      return this.depth - compareQuantity;
 
      //descending order
      //return compareQuantity - this.depth;
 
   }  
}