Esempio n. 1
0
 internal RefineJobVM(RefiningVM parentVM, StaticDataStore staticData, RefineingJob job, CommandReferences cmdRef)
 {
     _parent     = parentVM;
     _staticData = staticData;
     JobItem     = job;
     Item        = _staticData.CargoGoods.GetMaterial(JobItem.ItemGuid).Name;
     _cmdRef     = cmdRef;
 }
Esempio n. 2
0
 internal RefineJobVM(RefiningVM parentVM, StaticDataStore staticData, RefineingJob job, CommandReferences cmdRef)
 {
     _parent     = parentVM;
     _staticData = staticData;
     JobItem     = job;
     Item        = _staticData.ProcessedMaterials[JobItem.ItemGuid].Name;
     _cmdRef     = cmdRef;
 }
Esempio n. 3
0
        public static void AddJob(StaticDataStore staticData, Entity colonyEntity, RefineingJob job)
        {
            ColonyRefiningDB refiningDB = colonyEntity.GetDataBlob <ColonyRefiningDB>();

            lock (refiningDB.JobBatchList) //prevent threaded race conditions
            {
                //check if the job materialguid is valid, then add it if so.
                if (staticData.ProcessedMaterials.ContainsKey(job.ItemGuid))
                {
                    refiningDB.JobBatchList.Add(job);
                }
            }
        }
Esempio n. 4
0
 internal override bool IsValidCommand(Game game)
 {
     _staticData = game.StaticData;
     if (CommandHelpers.IsCommandValid(game.GlobalManager, RequestingFactionGuid, EntityCommandingGuid, out _factionEntity, out _entityCommanding))
     {
         if (_staticData.ProcessedMaterials.ContainsKey(MaterialGuid))
         {
             int pointCost = _staticData.ProcessedMaterials[MaterialGuid].RefineryPointCost;
             _job = new RefineingJob(MaterialGuid, NumberOrderd, pointCost, RepeatJob);
             return(true);
         }
     }
     return(false);
 }