package org.keyscience.models;

import android.content.Context;

import org.keyscience.R;

import java.util.ArrayList;

public class LectureSeriesModel {
    private int image;
    private String title;
    private String paragraph;

    public static ArrayList<LectureSeriesModel> getData(Context context) {
        ArrayList<LectureSeriesModel> data = new ArrayList<>();
        int[] images = getImages();
        String[] titles = getTitles(context);
        String[] paragraphs = getParagraphs(context);
        for (int i = 0; i < images.length; i++) {
            LectureSeriesModel model = new LectureSeriesModel();
            model.setImage(images[i]);
            model.setTitle(titles[i]);
            model.setParagraph(paragraphs[i]);
            data.add(model);
        }
        return data;
    }


    private static String[] getTitles(Context context) {
        String[] titles = {context.getString(R.string.WHAT), context.getString(R.string.BILL), context.getString(R.string.CHANGING),
                context.getString(R.string.HURRICANE), context.getString(R.string.INVASIVE), context.getString(R.string.MARINE),
                context.getString(R.string.REEF), context.getString(R.string.STONY), context.getString(R.string.YOUTH)};
        return titles;
    }

    private static String[] getParagraphs(Context context) {
        String[] paragraphs = {context.getString(R.string.WHATParagraph), context.getString(R.string.BILLParagraph), context.getString(R.string.CHANGINGParagraph),
                context.getString(R.string.HURRICANEParagraph), context.getString(R.string.INVASIVEParagraph), context.getString(R.string.MARINEParagraph),
                context.getString(R.string.REEFParagraph), context.getString(R.string.STONYParagraph), context.getString(R.string.YOUTHParagraph)};
        return paragraphs;
    }

    private static int[] getImages() {
        int[] images = {
                R.drawable.what_is_cit_sci, R.drawable.bill_baggs_lecture, R.drawable.changing_by_degrees_lecture,
                R.drawable.hurricane_lecture, R.drawable.invasive_species_lecture, R.drawable.marine_invertebrate_lecture,
                R.drawable.reef_fish_id_lecture, R.drawable.stony_coral_id_lecture, R.drawable.youth_fishing
        };
        return images;
    }

    public int getImage() {
        return image;
    }

    public void setImage(int image) {
        this.image = image;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getParagraph() {
        return paragraph;
    }

    public void setParagraph(String paragraph) {
        this.paragraph = paragraph;
    }

}
