Android Open Source - ubisoldiers Battle Activity






From Project

Back to project page ubisoldiers.

License

The source code is released under:

MIT License

If you think the Android project ubisoldiers listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.github.gobbisanches.ubisoldiers.app;
// ww  w  . ja va  2s  . c  o m
import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import com.github.gobbisanches.ubisoldiers.mechanics.*;

/**
 * Created by Sanches on 13/07/2014.
 */
public class BattleActivity extends SingleFragmentActivity  {
    private static final String ATTACKER_SQUAD = "com.github.gobbisanches.ubisoldier.app.BattleActivity.AttackerSquad";
    private static final String DEFENDER_SQUAD = "com.github.gobbisanches.ubisoldier.app.BattleActivity.DefenderSquad";
    private static final String BATTLE_LOG = "com.github.gobbisanches.ubisoldier.app.BattleActivity.BattleLog";

    private Squad attackerSquad;
    private Squad defenderSquad;
    private BattleLog battleLog;

    @Override
    protected Fragment createFragment() {
        attackerSquad = (Squad) getIntent().getSerializableExtra(ATTACKER_SQUAD);
        defenderSquad = (Squad) getIntent().getSerializableExtra(DEFENDER_SQUAD);
        battleLog     = (BattleLog)   getIntent().getSerializableExtra(BATTLE_LOG);

        return BattleFragment.newInstance(attackerSquad, defenderSquad, battleLog);
    }

    public static void startForBattle(Squad attackerSquad, Squad defenderSquad, BattleLog battleLog, Activity caller) {
        Intent intent = new Intent(caller, BattleActivity.class);

        intent.putExtra(ATTACKER_SQUAD, attackerSquad);
        intent.putExtra(DEFENDER_SQUAD, defenderSquad);
        intent.putExtra(BATTLE_LOG, battleLog);

        caller.startActivityForResult(intent, 0);
    }
}




Java Source Code List

com.github.gobbisanches.ubisoldiers.app.ArmyFragment.java
com.github.gobbisanches.ubisoldiers.app.BattleActivity.java
com.github.gobbisanches.ubisoldiers.app.BattleFragment.java
com.github.gobbisanches.ubisoldiers.app.ItemListFragment.java
com.github.gobbisanches.ubisoldiers.app.MainActivity.java
com.github.gobbisanches.ubisoldiers.app.ResourceManager.java
com.github.gobbisanches.ubisoldiers.app.SingleFragmentActivity.java
com.github.gobbisanches.ubisoldiers.app.UbisoldierUosApplication.java
com.github.gobbisanches.ubisoldiers.app.UbisoldiersDriver.java
com.github.gobbisanches.ubisoldiers.app.UnitCustomizationActivity.java
com.github.gobbisanches.ubisoldiers.app.UnitCustomizationFragment.java
com.github.gobbisanches.ubisoldiers.app.UnitFragment.java
com.github.gobbisanches.ubisoldiers.app.UosManager.java
com.github.gobbisanches.ubisoldiers.mechanics.Armor.java
com.github.gobbisanches.ubisoldiers.mechanics.BattleLogEntry.java
com.github.gobbisanches.ubisoldiers.mechanics.BattleLogParser.java
com.github.gobbisanches.ubisoldiers.mechanics.BattleLog.java
com.github.gobbisanches.ubisoldiers.mechanics.BattleSquad.java
com.github.gobbisanches.ubisoldiers.mechanics.BattleUnit.java
com.github.gobbisanches.ubisoldiers.mechanics.Battle.java
com.github.gobbisanches.ubisoldiers.mechanics.DefaultGameRules.java
com.github.gobbisanches.ubisoldiers.mechanics.GameRules.java
com.github.gobbisanches.ubisoldiers.mechanics.General.java
com.github.gobbisanches.ubisoldiers.mechanics.ItemCollection.java
com.github.gobbisanches.ubisoldiers.mechanics.Item.java
com.github.gobbisanches.ubisoldiers.mechanics.MechanicsEngine.java
com.github.gobbisanches.ubisoldiers.mechanics.PolicyManager.java
com.github.gobbisanches.ubisoldiers.mechanics.SearchEngine.java
com.github.gobbisanches.ubisoldiers.mechanics.Soldier.java
com.github.gobbisanches.ubisoldiers.mechanics.Squad.java
com.github.gobbisanches.ubisoldiers.mechanics.Unit.java
com.github.gobbisanches.ubisoldiers.mechanics.Weapon.java