Example #1
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.chase_activity_result);
   playerData =
       (PlayerData)
           this.getIntent()
               .getExtras()
               .getSerializable(GameSettings.CHASE_GAME_PLAYER_TO_RESULT_TAG);
   gameData =
       (GameData)
           this.getIntent().getExtras().getSerializable(GameSettings.CHASE_GAME_TO_RESULT_TAG);
   new ToolbarSetter(this);
   try {
     Results.setForChase(gameData, playerData);
   } catch (RestException e) {
     e.printStackTrace();
     e.getErrorAlert(this).show();
   }
   TextView result = (TextView) findViewById(R.id.resultsTextView);
   if (gameData.getChases().get(playerData.getUserID()).getStatus().equals(ChaseStatus.DEAD)) {
     result.setText("You LOSE!\n You're character is dead");
   } else {
     result.setText("You WIN!\n Hunter didn't catch you!");
   }
 }
Example #2
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_hunter_result);
   new ToolbarSetter(this);
   playerData =
       (PlayerData)
           this.getIntent()
               .getExtras()
               .getSerializable(GameSettings.HUNTER_GAME_PLAYER_TO_RESULT_TAG);
   gameData =
       (GameData)
           this.getIntent().getExtras().getSerializable(GameSettings.HUNTER_GAME_TO_RESULT_TAG);
   try {
     Results.setForHunter(gameData, playerData);
   } catch (RestException e) {
     e.printStackTrace();
     e.getErrorAlert(this).show();
   }
   TextView result = (TextView) findViewById(R.id.results2TextView);
   if (gameData.getStatus().equals(GameStatus.CHASE_WINS)) {
     result.setText("You LOSE!\n There were some chases still alive..");
   } else {
     result.setText("You WIN!\n All chases are dead!");
   }
 }