public override void OnNewBatchJob() { RefineingJob newjob = new RefineingJob(NewJobSelectedItem, NewJobBatchCount, _staticData_.ProcessedMaterials[NewJobSelectedItem].RefineryPointCost, NewJobRepeat); RefiningProcessor.AddJob(_staticData_, _colonyEntity_, newjob); Refresh(); }
//internal void Process(Game game, List<StarSystem> systems, int deltaSeconds) //{ // if (game.CurrentDateTime - _lastRun < game.Settings.EconomyCycleTime) // { // return; // } // _lastRun = game.CurrentDateTime; // if (game.Settings.EnableMultiThreading ?? false) // { // Parallel.ForEach(systems, system => ProcessSystem(system)); // } // else // { // foreach (var system in systems) //TODO thread this // { // ProcessSystem(system); // } // } //} internal static void ProcessSystem(EntityManager manager) { Game game = manager.Game; //Action<StarSystem> economyMethod = ProcessSystem; //system.SystemSubpulses.AddSystemInterupt(system.Game.CurrentDateTime + system.Game.Settings.EconomyCycleTime, economyMethod); manager.ManagerSubpulses.AddSystemInterupt(manager.Game.CurrentDateTime + manager.Game.Settings.EconomyCycleTime, PulseActionEnum.EconProcessor); TechProcessor.ProcessSystem(manager, game); foreach (Entity colonyEntity in manager.GetAllEntitiesWithDataBlob <ColonyMinesDB>()) { MineProcessor.MineResources(colonyEntity); } foreach (Entity colonyEntity in manager.GetAllEntitiesWithDataBlob <ColonyRefiningDB>()) { RefiningProcessor.RefineMaterials(colonyEntity, game); } foreach (Entity colonyEntity in manager.GetAllEntitiesWithDataBlob <ColonyConstructionDB>()) { ConstructionProcessor.ConstructStuff(colonyEntity, game); } foreach (Entity colonyEntity in manager.GetAllEntitiesWithDataBlob <ColonyInfoDB>()) { PopulationProcessor.GrowPopulation(colonyEntity); } }
public void OnComponentInstalation(Entity parentEntity, Entity componentInstance) { if (!parentEntity.HasDataBlob <RefiningDB>()) { parentEntity.SetDataBlob(new RefiningDB()); } RefiningProcessor.ReCalcRefiningRate(parentEntity); }
internal override void ActionCommand(Game game) { if (!IsRunning) { RefiningProcessor.AddJob(_staticData, _entityCommanding, _job); IsRunning = true; } }
internal override void ActionCommand(Game game) { RefiningProcessor.ChangeJobPriority(_entityCommanding, JobID, Delta); IsRunning = true; }
public void ProcessEntity(Entity entity, int deltaSeconds) { RefiningProcessor.RefineMaterials(entity, ProcessedMaterials); }