src/cellar.cpp
//Empty if there is no crate, shelf or bottle.
//TODO: find alternative to avoid checking all objects for position
Empty if there is no crate, shelf or bottle.
TODO: find alternative to avoid checking all objects for position
Empty if there is no crate shelf or bottle . TODO : find alternative to avoid checking all objects for position
bool CELLAR::EmptyTile(const CELLAR_STATE& cellarstate, const COORD& coord) const{
	bool empty = true;
	if(Grid.Inside(coord) && Grid(coord) >= 0 && Grid(coord) < NumBottles)
		empty = false;
	if(empty)
		for(int i=0; i<cellarstate.Objects.size() && empty; i++){
			if(cellarstate.Objects[i].ObjPos == coord)
				empty = false;
		}
	return empty;
}
bool CELLAR :: EmptyTile ( const CELLAR_STATE & cellarstate , const COORD & coord ) const { bool empty = true ; if ( Grid . Inside ( coord ) && Grid ( coord ) >= 0 && Grid ( coord ) < NumBottles ) empty = false ; if ( empty ) for ( int i = 0 ; i < cellarstate . Objects . size ( ) && empty ; i ++ ) { if ( cellarstate . Objects [ i ] . ObjPos == coord ) empty = false ; } return empty ; }
Empty if there is no crate, shelf or bottle.
Empty if there is no crate shelf or bottle .
// If there is a bottle, not empty //If no bottles but objects, not empty