package com.m2sdl.undercooked.services;

import com.m2sdl.undercooked.domain.PoiRepository;
import com.m2sdl.undercooked.domain.Restaurant;

import org.mapsforge.core.model.LatLong;

public class PoiService {
    private final PoiRepository poiRepository;

    public PoiService(String DbPath) {
        this.poiRepository = new PoiRepository(DbPath);
    }

    public Restaurant getRestaurant(LatLong position) {
        return poiRepository.findRestaurantByPosition(position);
    }

    public void finish() {
        poiRepository.close();
    }
}
