Beispiel #1
0
 public static void AddJob(IndustryAbilityDB industryDB, Guid plineID, IndustryJob job)
 {
     lock (industryDB.ProductionLines[plineID])
     {
         var pline = industryDB.ProductionLines[plineID];
         pline.Jobs.Add(job);
     }
 }
Beispiel #2
0
        public void OnComponentInstallation(Entity parentEntity, ComponentInstance componentInstance)
        {
            var db = parentEntity.GetDataBlob <IndustryAbilityDB>();

            IndustryAbilityDB.ProductionLine newline = new IndustryAbilityDB.ProductionLine();
            newline.MaxVolume         = MaxProductionVolume;
            newline.IndustryTypeRates = IndustryPoints;
            newline.FacName           = componentInstance.Name;

            if (db == null)
            {
                db = new IndustryAbilityDB(componentInstance.ID, newline);
                parentEntity.SetDataBlob(db);
            }
            else
            {
                db.ProductionLines.Add(componentInstance.ID, newline);
            }
        }
Beispiel #3
0
 public IndustryAbilityDB(IndustryAbilityDB db)
 {
     //IndustryTypeRates = new Dictionary<Guid, int>(db.IndustryTypeRates);
     ProductionLines = new Dictionary <Guid, ProductionLine>(db.ProductionLines);
 }