import java.awt.*;

class CD_CELL extends GENERIC_CELL{

  int value;
  int index;

  CD_CELL(int v, int i, Color cc){
    super((i%9)*20+50,(i/9)*15+10,cc); 
    value = v;
    index=i;
  }

  public void moveX(int n){
  //overrides moveX in GENERIC_CELL
    x += 20 * n;
  }

  public int getValue(){
    return value;
  }

  public void setValue(int n){
    value=n;
  }

  public int getLocation(){
    return index;
  }

  public void draw(Graphics g, boolean special){
    if(special){
      g.setColor(Color.cyan);
      g.fillRect(x,y,20,15);
      if(value>0){
        g.setColor(Color.black);
        g.drawString("" + value, x+5, y+13);
      }
    }
    else if(value > -1){
      g.setColor(c);
      g.fillRect(x,y,20,15);
      if(value>0){
        g.setColor(Color.black);
        g.drawString(""+value, x+5,y+13);
      }
    }
  }
}

