示例#1
0
 public void UnlinkComponent(IndustrialComponent component)
 {
     if (components.Contains(component))
     {
         components.Remove(component);
         productionMulti -= component.productionMulti;
     }
 }
示例#2
0
 public void LinkComponent(IndustrialComponent component)
 // Sent from component, completes link
 {
     if (!components.Contains(component))
     {
         components.Add(component);
         productionMulti += component.productionMulti;
     }
 }
 void ClearTrackers()
 {
     res     = null;
     com     = null;
     ind     = null;
     off     = null;
     indc    = null;
     fol     = null;
     serv    = null;
     tracker = null;
 }
 void SetTracker()
 {
     ClearTrackers();
     tracker = containedBuilding.GetComponent <ItemTracker>();
     if (containedType == 0)
     {
         res        = containedBuilding.GetComponent <ResidentialTracker>();
         res.usable = false;
     }
     else if (containedType == 1)
     {
         com        = containedBuilding.GetComponent <CommercialTracker>();
         com.usable = false;
     }
     else if (containedType == 2)
     {
         ind        = containedBuilding.GetComponent <IndustrialTracker>();
         ind.usable = false;
     }
     else if (containedType == 3)
     {
         off        = containedBuilding.GetComponent <CommercialTracker>();
         off.usable = false;
     }
     else if (containedType == 4)
     {
         indc        = containedBuilding.GetComponent <IndustrialComponent>();
         indc.usable = false;
     }
     else if (containedType == 5)
     {
         fol        = containedBuilding.GetComponent <FoliageTracker>();
         fol.active = false;
     }
     else if (containedType == 6)
     {
         serv        = containedBuilding.GetComponent <ServiceTrackerBase>();
         serv.active = true;
     }
 }