package com.example.jmastermind.Events;

import android.content.Intent;
import android.media.MediaPlayer;
import android.view.animation.Animation;
import androidx.appcompat.app.AppCompatActivity;
import com.example.jmastermind.Menu.Menu;

public class PrologueAnimation implements Animation.AnimationListener {
    private AppCompatActivity context;
    private MediaPlayer mp;

    /**
     * Sert a savoir si le prologue a finit de s'afficher
     * @param context Le contexte.
     * @param mp La musique du prologue.
     * */
    public PrologueAnimation(AppCompatActivity context, MediaPlayer mp) {
        this.context = context;
        this.mp = mp;
    }

    @Override
    public void onAnimationStart(Animation animation) {
    }

    @Override
    public void onAnimationEnd(Animation animation) {
        this.mp.stop();
        Intent i =  new Intent(this.context, Menu.class);
        this.context.startActivity(i);
    }

    @Override
    public void onAnimationRepeat(Animation animation) {

    }
}
