package com.example.Reticule;

import android.app.Activity;
import android.os.Bundle;

import androidx.annotation.NonNull;

public class MainActivity extends Activity {
    private Fenetre vue;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        this.vue = (Fenetre) findViewById(R.id.vuee);
    }

    @Override
    public void onSaveInstanceState(@NonNull Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putFloat("x", this.vue.controleur.getReticuleX());
        outState.putFloat("x", this.vue.controleur.getReticuleY());
    }

    @Override
    public void onRestoreInstanceState(@NonNull Bundle savedInstanceState){
        super.onRestoreInstanceState(savedInstanceState);
        this.vue.controleur.setReticuleX(savedInstanceState.getFloat("x"));
        this.vue.controleur.setReticuleY(savedInstanceState.getFloat("y"));
    }
}