package com.example.jmastermind.Game;

import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.example.jmastermind.Deck.DeckWinner;
import com.example.jmastermind.Menu.Menu;
import com.example.jmastermind.R;
import java.util.ArrayList;

public class Game extends AppCompatActivity {
    /**
     * Le jeu.
     * */
    public Game() {}

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.game);

        Intent i = this.getIntent();
        ArrayList<Integer> combi = i.getIntegerArrayListExtra("DefendCombi");

        if(combi != null) {
            DeckWinner dw = new DeckWinner(combi.get(0), combi.get(1), combi.get(2), combi.get(3), true);
            Controller controller = new Controller(this, 1, dw);
        } else {
            Controller controller = new Controller(this, 0);
        }
    }

    @Override
    public void onBackPressed() {
        Intent i = new Intent(this, Menu.class);
        this.startActivity(i);
    }
}
