Esempio n. 1
0
 private bool IsValidRepair()
 {
     RepairMng       = new RepairManager(SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeck.AreaId);
     repairDockModel = null;
     RepairDockModel[] docks = RepairMng.GetDocks();
     if (FocusBanner.ShipModel.NowHp >= FocusBanner.ShipModel.MaxHp)
     {
         CommonPopupDialog.Instance.StartPopup(Util.getPopupMessage(PopupMess.NoDamage));
         return(false);
     }
     if (SingletonMonoBehaviour <AppInformation> .Instance.CurrentDeckAreaModel.NDockMax == 0)
     {
         CommonPopupDialog.Instance.StartPopup("この海域には入渠ドックがありません");
         return(false);
     }
     for (int i = 0; i < RepairMng.GetDocks().Length; i++)
     {
         if (docks[i].State == NdockStates.EMPTY)
         {
             repairDockModel = docks[i];
             break;
         }
     }
     if (repairDockModel == null)
     {
         CommonPopupDialog.Instance.StartPopup("入渠ドックに空きがありません");
         return(false);
     }
     if (!RepairMng.IsValidStartRepair(FocusBanner.ShipModel.MemId))
     {
         CommonPopupDialog.Instance.StartPopup("資源が不足しています");
         return(false);
     }
     return(true);
 }