package com.bernard.mcqinator.view.activities.congratsActivity;

import android.app.Activity;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.Nullable;

import com.bernard.mcqinator.api.QuizMetadata;
import com.bernard.mcqinator.api.fragen.Frage;

import java.util.List;

/**
 * @author Mysaa
 * @date on 27/07/17.
 */

public abstract class CongratsActivity extends Activity {

    public static final String FRAGEN = "com.bernard.qcminator.FRAGEN";
    public static final String REPLIES = "com.bernard.qcminator.REPLIES";
    public static final String QUIZ_DATA = "com.bernard.qcminator.QUIZ_DATA";

    QuizMetadata meta;
    Frage[] fragen;
    List<Frage.Reply> replies;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //TODO check intent
        meta = getIntent().getParcelableExtra(QUIZ_DATA);
        Parcelable[] pfragen =  getIntent().getParcelableArrayExtra(FRAGEN);
        fragen = new Frage[pfragen.length];
        for (int i = 0; i < pfragen.length; i++)fragen[i] = (Frage)pfragen[i];
        replies = getIntent().getParcelableArrayListExtra(REPLIES);

        create(savedInstanceState);
    }

    public abstract void create(@Nullable Bundle savedInstanceState);


}
