// Path: android/src/com/metalrain/stocksimulator/android/StockSimulator.java
// public class StockSimulator extends Application {
// 
//     private GameState state;
// 
//     private static StockSimulator instance;
// 
//     public static GameState getGameState() {
//         return instance.state;
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         instance = this;
//     }
// 
//     public static void initializeGameState(int seed, int iterations) {
//         instance.state = new GameState(seed, iterations);
//     }
// 
//     public static boolean hasGameStarted() {
//         return (instance.state != null);
//     }
// }


import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import com.metalrain.stocksimulator.android.R;
import com.metalrain.stocksimulator.android.StockSimulator;
import butterknife.ButterKnife;
import butterknife.InjectView;
        });

        gameLength.setAdapter(new GameLengthAdapter());
    }

    private void resumeGame(View v) {
        Intent i = new Intent(v.getContext(), StockSimulatorActivity.class);
        startActivity(i);
    }

    private void startGame(View v) {
        int seed = (int) (Math.random() * 1000000);
        int iterations = ((eGameLength) gameLength.getSelectedItem()).length;

        try {
            String input_seed = randomSeed.getText().toString();
            if (!TextUtils.isEmpty(input_seed)) {
                seed = Integer.parseInt(input_seed);
            }
        } catch (Exception e) {
        }

        StockSimulator.initializeGameState(seed, iterations);
        Intent i = new Intent(v.getContext(), StockSimulatorActivity.class);
        startActivity(i);
    }

    @Override
    protected void onResume() {
        super.onResume();
// Path: android/src/com/metalrain/stocksimulator/android/StockSimulator.java
// public class StockSimulator extends Application {
// 
//     private GameState state;
// 
//     private static StockSimulator instance;
// 
//     public static GameState getGameState() {
//         return instance.state;
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         instance = this;
//     }
// 
//     public static void initializeGameState(int seed, int iterations) {
//         instance.state = new GameState(seed, iterations);
//     }
// 
//     public static boolean hasGameStarted() {
//         return (instance.state != null);
//     }
// }


// Path: android/src/com/metalrain/stocksimulator/android/activities/MainMenuActivity.java
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.TextView;
import com.metalrain.stocksimulator.android.R;
import com.metalrain.stocksimulator.android.StockSimulator;
import butterknife.ButterKnife;
import butterknife.InjectView;

        });

        gameLength.setAdapter(new GameLengthAdapter());
    }

    private void resumeGame(View v) {
        Intent i = new Intent(v.getContext(), StockSimulatorActivity.class);
        startActivity(i);
    }

    private void startGame(View v) {
        int seed = (int) (Math.random() * 1000000);
        int iterations = ((eGameLength) gameLength.getSelectedItem()).length;

        try {
            String input_seed = randomSeed.getText().toString();
            if (!TextUtils.isEmpty(input_seed)) {
                seed = Integer.parseInt(input_seed);
            }
        } catch (Exception e) {
        }

        StockSimulator.initializeGameState(seed, iterations);
        Intent i = new Intent(v.getContext(), StockSimulatorActivity.class);
        startActivity(i);
    }

    @Override
    protected void onResume() {
        super.onResume();
        resumeGame.setVisibility((StockSimulator.hasGameStarted()) ? View.VISIBLE : View.GONE);