using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class PretestMenu : MonoBehaviour, IDataPresistence
{
    public List<Image> hasilJawaban;

    public Sprite jawabanBenar;
    public Sprite jawabanSalah;
    public Sprite jawabanNull;

    public void LoadData(GameData data)
    {
        for (int  i = 0; i < hasilJawaban.Count; i++)
        {
            foreach (var item in data.jawabanPretest)
            {
                if (data.jawabanPretest[i] == 1)
                {
                    hasilJawaban[i].sprite = jawabanBenar;
                }
                else if (data.jawabanPretest[i] == 2)
                {
                    hasilJawaban[i].sprite = jawabanSalah;
                }
                else
                {
                    hasilJawaban[i].sprite = jawabanNull;
                }
            }
        }
    }

    public void SaveData(ref GameData data) {}
}
