package com.ar.ardrawingboard.util;

import android.content.Context;

import com.ar.ardrawingboard.room.AppDatabase;
import com.ar.ardrawingboard.room.BoardEntry;
import com.ar.ardrawingboard.room.BoardEntryDao;

import java.util.ArrayList;
import java.util.List;

public class RoomInit {

    private final BoardEntryDao boardEntryDao;

    public RoomInit(Context context) {
        AppDatabase db = AppDatabase.getInstance(context);
        boardEntryDao = db.boardEntryDao();
    }

    public void insertAllImages(List<String> imagePaths) {
        List<BoardEntry> imageEntries = new ArrayList<>();
        for (String path : imagePaths) {
            imageEntries.add(new BoardEntry(false, false, path));
        }

        boardEntryDao.insertAll(imageEntries);
    }
}
