コード例 #1
0
 public void UpdateBoosterPartners()
 {
     foreach (BoosterData partner in RelationsBoosterCache)
     {
         float       relation        = partner.Relation;
         double      time            = partner.Time;
         string      partnerName     = partner.faction;
         FactionData TargetedFaction = factionsData[partnerName];
         BoosterData TheBooster      = null;
         foreach (BoosterData TempRelation in TargetedFaction.Boosters)
         {
             if (TempRelation.faction == FactionName)
             {
                 TheBooster = TempRelation;
             }
         }
         if (TheBooster != null)
         {
             TheBooster.Relation = relation;
             TheBooster.Time     = time;
         }
         else
         {
             Logger.Error("A partner did not found the current faction in its booster relation list.");
         }
     }
 }
コード例 #2
0
 public void RemoveBooster(BoosterData booster)
 {
     booster.Remove();
     Boosters.Remove(booster);
     if (Boosters.Count <= 0 && Relations.Count <= 0)
     {
         // Only removed if both Relations and Boosters are null (they have the same parent node "relations" in save file).
         FactionNode.RemoveChild(XMLFunctions.FindChild(FactionNode, "relations"));
     }
 }