package com.example.jmastermind.Game;

import android.graphics.Color;
import android.os.Bundle;
import android.widget.Button;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.example.jmastermind.Events.DefendCombiSelectorEvent;
import com.example.jmastermind.Events.DefendValidateEvent;
import com.example.jmastermind.Geometrics.Circle;
import com.example.jmastermind.R;

public class ColorDefSelect extends AppCompatActivity {

    /**
     * La selection d'un combinaison du mode multi.
     * */
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.defend);

        DefendCombiSelectorEvent dce = new DefendCombiSelectorEvent(this);
        DefendValidateEvent dve = new DefendValidateEvent(this, dce);

        Circle red = (Circle) findViewById(R.id.selectRed);
        red.setColor(Color.RED);
        red.setOnClickListener(dce);

        Circle blue = (Circle) findViewById(R.id.selectBlue);
        blue.setColor(Color.BLUE);
        blue.setOnClickListener(dce);

        Circle yellow = (Circle) findViewById(R.id.selectYellow);
        yellow.setColor(Color.YELLOW);
        yellow.setOnClickListener(dce);

        Circle green = (Circle) findViewById(R.id.selectGreen);
        green.setColor(Color.GREEN);
        green.setOnClickListener(dce);

        Circle black = (Circle) findViewById(R.id.selectBlack);
        black.setColor(Color.BLACK);
        black.setOnClickListener(dce);

        Circle white = (Circle) findViewById(R.id.selectWhite);
        white.setColor(Color.WHITE);
        white.setOnClickListener(dce);

        Button validate = (Button) findViewById(R.id.selectValidate);
        validate.setOnClickListener(dve);

        Button reset = (Button) findViewById(R.id.selectReset);
        reset.setOnClickListener(dve);

        Button back = (Button) findViewById(R.id.selectBack);
        back.setOnClickListener(dve);
    }
}
