package bricklesPackage;
import java.util.Vector;
import java.awt.Point;

class PlayingField extends ArcadeGameObject{
	protected ArcadeGameMatch _match;
	protected ArcadeGame _game;
	protected Vector list;

	public PlayingField(ArcadeGame aGame){
		_game = aGame;
		list = new Vector(10);
	}

	public void moved(MovablePiece mPiece) throws Collision
	{
		ArcadeGamePiece piece;
		//Point atPoint = new Point(0,0);
		if(!list.isEmpty()){
			for(int i=0; i< list.size(); i++){
				piece = (ArcadeGamePiece)list.elementAt(i);
				if(piece.isContained(mPiece.getPosition())){
					throw  new Collision(mPiece,piece,mPiece.getPosition());
				}
			}

		}

	}

	public void deleted(MovablePiece mPiece){
		_match.deleted(mPiece);
	}

};
