예제 #1
0
 public void StartUpgrade(UpgradeableFacility facilityToUpgrade)
 {
     Upgrade   = new FacilityUpgradeEvent(facilityToUpgrade.id, this);
     Upgrading = true;
     ScreenMessages.PostScreenMessage("[Bureaucracy]: Upgrade of " + Name + " requested");
     Debug.Log("[Bureaucracy]: Upgrade of " + Name + " requested for " + Upgrade.OriginalCost);
 }
예제 #2
0
 public void CancelUpgrade()
 {
     Upgrade    = null;
     Upgrading  = false;
     IsPriority = false;
     Debug.Log("[Bureaucracy]: Upgrade of " + Name + " cancelled");
     ScreenMessages.PostScreenMessage("[Bureaucracy]: " + Name + " - Upgrade cancelled");
 }
예제 #3
0
 public void OnUpgradeCompleted()
 {
     Upgrading        = false;
     Upgrade          = null;
     recentlyUpgraded = true;
     IsPriority       = false;
     Debug.Log("[Bureaucracy]: Upgrade of " + Name + " completed");
 }
예제 #4
0
 public string GetProgressReport(FacilityUpgradeEvent upgrade)
 {
     // ReSharper disable once BuiltInTypeReferenceStyleForMemberAccess
     if (!Upgrading && !recentlyUpgraded)
     {
         return(String.Empty);
     }
     if (!recentlyUpgraded)
     {
         return(Name + ": $" + (upgrade.OriginalCost - upgrade.RemainingInvestment) + " / " + upgrade.OriginalCost);
     }
     recentlyUpgraded = false;
     return(Name + ": Upgrade completed successfully");
 }
예제 #5
0
 public void OnLoad(ConfigNode[] facilityNodes)
 {
     for (int i = 0; i < facilityNodes.Length; i++)
     {
         ConfigNode cn = facilityNodes.ElementAt(i);
         if (cn.GetValue("Name") != Name)
         {
             continue;
         }
         bool.TryParse(cn.GetValue("RecentlyUpgraded"), out recentlyUpgraded);
         bool.TryParse(cn.GetValue("Closed"), out isClosed);
         bool.TryParse(cn.GetValue("isPriority"), out IsPriority);
         int.TryParse(cn.GetValue("LaunchesThisMonth"), out LaunchesThisMonth);
         SetCosts();
         ConfigNode upgradeNode = cn.GetNode("UPGRADE");
         if (upgradeNode == null)
         {
             return;
         }
         Upgrading = true;
         Upgrade   = new FacilityUpgradeEvent(upgradeNode.GetValue("ID"), this);
         Upgrade.OnLoad(upgradeNode);
     }
 }