# WARNING - Generated by {fusen} from dev/flat_scenario.Rmd: do not edit by hand # nolint: line_length_linter.

#' Query crop height
#' 
#' Retrieve height of the crop simulated
#' @param cropName integer, identifier of the crop simulated
#' @return height
#' 
#' @export
#' @examples
#' query_crop_height("Tomato")
query_crop_height <- function(cropName){
  allowed_crop <- c("Corn seed", "Potato", "Tomato", "Onion", "Apple", "Salad")
  if (any(!cropName %in% allowed_crop)){
    stop("Crop name doesn't exist")}

  height <- config_ambre$crop |>
    filter(CropName %in% cropName) |>
    pull(CropHeight) 
    return(height)
}
