package com.example.mirnabouchra.cloudolympics.games;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;

import com.example.mirnabouchra.cloudolympics.Consts;
import com.example.mirnabouchra.cloudolympics.GameActivity;
import com.example.mirnabouchra.cloudolympics.R;
import com.firebase.client.Firebase;

public class EndOfGameActivity extends GameActivity {
    private static final String LOG_TAG = EndOfGameActivity.class.getSimpleName();

    @Override
    public void onCreate(Bundle savedInstanceState) {
        state = GameState.DONE;

        super.onCreate(savedInstanceState);
        setContentView(R.layout.end_of_game);

        final ImageButton button = (ImageButton) findViewById(R.id.startButton);
        button.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {

            }
        });

    }
}

@@ -471,24 +471,93 @@
 pleName();%0A%0A
+    private Firebase stateRef;%0A    private Firebase currentGameRef;%0A%0A
     @Overrid
@@ -558,16 +558,16 @@
 verride%0A
-
     publ
@@ -732,24 +732,204 @@
 _of_game);%0A%0A
+        stateRef = new Firebase(Consts.FIREBASE_URL + %22/room/%22 + code + %22/state%22);%0A        currentGameRef = new Firebase(Consts.FIREBASE_URL + %22/room/%22 + code + %22/currentGame%22);%0A%0A%0A
         fina
@@ -1102,16 +1102,203 @@
 ew v) %7B%0A
+                // we should be at %22done%0A                stateRef.setValue(%22waiting%22);%0A                currentGameRef.setValue(-1);%0A%0A                // TODO, change the player scores to 0
 %0A       

reset game state and game number to initial state when hitting replay