コード例 #1
0
ファイル: SolGame.java プロジェクト: Rulasmur/DestinationSol
 public void saveShip() {
   if (myTutorialManager != null) return;
   HullConfig hull;
   float money;
   ArrayList<SolItem> items;
   if (myHero != null) {
     hull = myHero.getHull().config;
     money = myHero.getMoney();
     items = new ArrayList<SolItem>();
     for (List<SolItem> group : myHero.getItemContainer()) {
       for (SolItem i : group) {
         items.add(0, i);
       }
     }
   } else if (myTranscendentHero != null) {
     FarShip farH = myTranscendentHero.getShip();
     hull = farH.getHullConfig();
     money = farH.getMoney();
     items = new ArrayList<SolItem>();
     for (List<SolItem> group : farH.getIc()) {
       for (SolItem i : group) {
         items.add(0, i);
       }
     }
   } else {
     hull = myRespawnHull;
     money = myRespawnMoney;
     items = myRespawnItems;
   }
   SaveManager.writeShip(hull, money, items, this);
 }
コード例 #2
0
ファイル: SolGame.java プロジェクト: Rulasmur/DestinationSol
 public void respawn() {
   if (myHero != null) {
     beforeHeroDeath();
     myObjectManager.removeObjDelayed(myHero);
   } else if (myTranscendentHero != null) {
     FarShip farH = myTranscendentHero.getShip();
     setRespawnState(farH.getMoney(), farH.getIc(), farH.getHullConfig());
     myObjectManager.removeObjDelayed(myTranscendentHero);
   }
   createPlayer(null);
 }