package org.keyscience.models;

import android.content.Context;

import org.keyscience.R;

import java.util.ArrayList;

public class OurBiomesModel {
    private int image;
    private String title;
    private String sub;
    private String content;

    public static ArrayList<OurBiomesModel> getData(Context context) {
        ArrayList<OurBiomesModel> data = new ArrayList<>();
        int[] images = getImages();
        String[] titles = getTitles(context);
        String[] subs = getSubs(context);
        String[] contents = getContents(context);
        for (int i = 0; i < images.length; i++) {
            OurBiomesModel model = new OurBiomesModel();
            model.setImage(images[i]);
            model.setTitle(titles[i]);
            model.setSub(subs[i]);
            model.setContent(contents[i]);
            data.add(model);
        }
        return data;
    }


    private static String[] getTitles(Context context) {
        String[] titles = {context.getString(R.string.KB_BEACHES), context.getString(R.string.KB_GREEN), context.getString(R.string.KB_BIKING),
                context.getString(R.string.KB_MANGROVE), context.getString(R.string.KB_CORALREEFS), context.getString(R.string.KB_WATERWAYS),
                context.getString(R.string.KB_SEAGRASS)};
        return titles;
    }

    private static String[] getSubs(Context context) {
        String[] paragraphs = {context.getString(R.string.KB_BEACHES_SUB), context.getString(R.string.KB_GREEN_SUB), context.getString(R.string.KB_BIKING_SUB),
                context.getString(R.string.KB_MANGROVE_SUB), context.getString(R.string.KB_CORALREEFS_SUB), context.getString(R.string.KB_WATERWAYS_SUB),
                context.getString(R.string.KB_SEAGRASS_SUB)};
        return paragraphs;
    }

    private static String[] getContents(Context context) {
        String[] paragraphs = {context.getString(R.string.KB_BEACHES_CONTENT), context.getString(R.string.KB_GREEN_CONTENT), context.getString(R.string.KB_BIKING_CONTENT),
                context.getString(R.string.KB_MANGROVE_CONTENT), context.getString(R.string.KB_CORALREEFS_CONTENT), context.getString(R.string.KB_WATERWAYS_CONTENT),
                context.getString(R.string.KB_SEAGRASS_CONTENT)};
        return paragraphs;
    }

    private static int[] getImages() {
        int[] images = {
                R.drawable.beaches, R.drawable.green_spaces, R.drawable.paths,
                R.drawable.mangroves, R.drawable.coral_reefs, R.drawable.waterways,
                R.drawable.seagrasses};
        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 getSub() {
        return sub;
    }

    public void setSub(String sub) {
        this.sub = sub;
    }

    public String getContents() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}
