package com.divya.animaltap.data

import com.divya.animaltap.R
import com.divya.animaltap.model.Animal

object AnimalRepository {
    val animals = listOf(
        Animal(1, R.string.dog, R.drawable.dog, "🐶", R.raw.dog_name, R.raw.dog_sound, R.color.card_blue),
        Animal(2, R.string.cat, R.drawable.cat, "🐱", R.raw.cat_name, R.raw.cat_sound, R.color.card_pink),
        Animal(3, R.string.cow, R.drawable.cow, "🐮", R.raw.cow_name, R.raw.cow_sound, R.color.card_green),
        Animal(4, R.string.lion, R.drawable.lion, "🦁", R.raw.lion_name, R.raw.lion_sound, R.color.card_orange),
        Animal(5, R.string.elephant, R.drawable.elephant, "🐘", R.raw.elephant_name, R.raw.elephant_sound, R.color.card_purple),
        Animal(6, R.string.horse, R.drawable.horse, "🐴", R.raw.horse_name, R.raw.horse_sound, R.color.card_blue),
        Animal(7, R.string.monkey, R.drawable.monkey, "🐵", R.raw.monkey_name, R.raw.monkey_sound, R.color.card_orange),
        Animal(8, R.string.sheep, R.drawable.sheep, "🐑", R.raw.sheep_name, R.raw.sheep_sound, R.color.card_green),
        Animal(9, R.string.goat, R.drawable.goat, "🐐", R.raw.goat_name, R.raw.goat_sound, R.color.card_pink),
        Animal(10, R.string.tiger, R.drawable.tiger, "🐯", R.raw.tiger_name, R.raw.tiger_sound, R.color.card_purple),
        Animal(11, R.string.pig, R.drawable.pig, "🐷", R.raw.pig_name, R.raw.pig_sound, R.color.card_pink),
        Animal(12, R.string.duck, R.drawable.duck, "🦆", R.raw.duck_name, R.raw.duck_sound, R.color.card_blue),
        Animal(13, R.string.chicken, R.drawable.chicken, "🐔", R.raw.chicken_name, R.raw.chicken_sound, R.color.card_orange),
        Animal(14, R.string.frog, R.drawable.frog, "🐸", R.raw.frog_name, R.raw.frog_sound, R.color.card_green),
        Animal(15, R.string.bear, R.drawable.bear, "🐻", R.raw.bear_name, R.raw.bear_sound, R.color.card_purple),
        Animal(16, R.string.zebra, R.drawable.zebra, "🦓", R.raw.zebra_name, R.raw.zebra_sound, R.color.card_blue),
        Animal(17, R.string.panda, R.drawable.panda, "🐼", R.raw.panda_name, R.raw.panda_sound, R.color.card_green),
        Animal(18, R.string.wolf, R.drawable.wolf, "🐺", R.raw.wolf_name, R.raw.wolf_sound, R.color.card_orange),
        Animal(19, R.string.owl, R.drawable.owl, "🦉", R.raw.owl_name, R.raw.owl_sound, R.color.card_purple),
        Animal(20, R.string.fox, R.drawable.fox, "🦊", R.raw.fox_name, R.raw.fox_sound, R.color.card_pink),
        Animal(21, R.string.giraffe, R.drawable.giraffe, "🦒", R.raw.giraffe_name, R.raw.giraffe_sound, R.color.card_orange),
        Animal(22, R.string.hippo, R.drawable.hippo, "🦛", R.raw.hippo_name, R.raw.hippo_sound, R.color.card_blue),
        Animal(23, R.string.rhino, R.drawable.rhino, "🦏", R.raw.rhino_name, R.raw.rhino_sound, R.color.card_green),
        Animal(24, R.string.shark, R.drawable.shark, "🦈", R.raw.shark_name, R.raw.shark_sound, R.color.card_blue),
        Animal(25, R.string.whale, R.drawable.whale, "🐋", R.raw.whale_name, R.raw.whale_sound, R.color.card_purple),
        Animal(26, R.string.penguin, R.drawable.penguin, "🐧", R.raw.penguin_name, R.raw.penguin_sound, R.color.card_pink),
        Animal(27, R.string.kangaroo, R.drawable.kangaroo, "🦘", R.raw.kangaroo_name, R.raw.kangaroo_sound, R.color.card_orange),
        Animal(28, R.string.koala, R.drawable.koala, "🐨", R.raw.koala_name, R.raw.koala_sound, R.color.card_green),
        Animal(29, R.string.gorilla, R.drawable.gorilla, "🦍", R.raw.gorilla_name, R.raw.gorilla_sound, R.color.card_purple),
        Animal(30, R.string.bee, R.drawable.bee, "🐝", R.raw.bee_name, R.raw.bee_sound, R.color.card_pink)
    )

    fun getNextAnimal(currentId: Int): Animal {
        val currentIndex = animals.indexOfFirst { it.id == currentId }
        val nextIndex = if (currentIndex == -1) 0 else (currentIndex + 1) % animals.size
        return animals[nextIndex]
    }
}
