package com.example.jmastermind.Menu;

import android.media.MediaPlayer;
import android.os.Bundle;
import android.widget.Button;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.example.jmastermind.Events.MenuEvent;
import com.example.jmastermind.Game.MultiGame;
import com.example.jmastermind.Game.SoloGame;
import com.example.jmastermind.R;

public class Menu extends AppCompatActivity {
    private MediaPlayer mp;

    /**
     * Le jeu mode SOLO
     * */
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.menu);

        this.mp = MediaPlayer.create(this, R.raw.menusong);
        this.mp.setLooping(true);
        this.mp.start();

        Button btnSoloGame = (Button) findViewById(R.id.robotselect);
        btnSoloGame.setOnClickListener(new MenuEvent(this, SoloGame.class, this.mp));

        Button btnMultiGame = (Button) findViewById(R.id.jcjselect);
        btnMultiGame.setOnClickListener(new MenuEvent(this, MultiGame.class, this.mp));
    }
}
