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 ac;
    private MediaPlayer mp;

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

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

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