package app.brest.testmin3d;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import app.brest.utils.app.brest.game.Game;
import app.brest.utils.geometry.GPSPoint;

public class SplashActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        checkSaved();
        GPSPoint a = new GPSPoint(48.3845125, -4.493831);
        GPSPoint b = new GPSPoint(48.3840495, -4.5037464);
        Log.e("GPS", "OUT:"+a.getDistanceWith(b));
                ;
    }

    public void onClickNew(View v)
    {
        Intent intent = new Intent(this, ARActivity.class);
        intent.putExtra("game_name", "game_medium");
        startActivity(intent);
    }

    public void onClickContinue(View v)
    {
        Intent intent = new Intent(this, ARActivity.class);
        startActivity(intent);
    }

    protected void onResume()
    {
        super.onResume();
        checkSaved();
    }

    protected void checkSaved()
    {
        View v = (View) findViewById(R.id.button_continue);
        if(Game.isSaved(this))
            v.setVisibility(View.VISIBLE);
        else
            v.setVisibility(View.INVISIBLE);
    }
}
