package bricklesPackage;
import java.awt.*;

class BrickPile extends CompositePiece{

	public BrickPile(PlayingField fieldPtr,Point atPoint1,BricklesView theView){
		super(fieldPtr,atPoint1);
      int initialX = atPoint1.x;
      int initialY = atPoint1.y;
      int x = initialX;
      int y = initialY;
	final int numberOfBricks = 6;
      for(int i=0;i< numberOfBricks;i++){
   		_list.addElement(new Brick((BricklesPlayingField)fieldPtr,new Point(x,y),theView));
      	x = x + 70;
      }
      _extent = new Dimension(440,25);
      _boundingBox = new Rectangle(_currentPosition,_extent);
	}

	public void collideWith(ArcadeGamePiece aPiece, Point atPoint){
	}


	public void collideWithPaddle(Paddle aPaddle,Point atPoint){

	}

	public void collideWithPuck(Puck aPuck, Point atPoint){
		for(int i =0;i < this.getSize();i++){
      	((Brick)_list.elementAt(i)).collideWithPuck(aPuck,atPoint);
      }
	}

	public Brick getBrickAt(int i){
   	return (Brick)_list.elementAt(i);
   }

	public int getSize(){
		return _list.size();	
	}
}
