package com.example.jmastermind.Events;

import android.content.Intent;
import android.media.MediaPlayer;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;

public class MenuEvent implements View.OnClickListener {
    private Class option;
    private AppCompatActivity context;
    private MediaPlayer mp;

    /**
     * Event lié au menu de depart.
     * @param context Le contexte.
     * @param option La class de l'activité a demarrer.
     * @param mp Couper le son d'une activite.
     * */
    public MenuEvent(AppCompatActivity context, Class option, MediaPlayer mp) {
        this.context = context;
        this.option = option;
        this.mp = mp;
    }

    @Override
    public void onClick(View view) {
        this.mp.stop();

        Intent i =  new Intent(this.context, this.option);
        this.context.startActivity(i);
    }
}
