예제 #1
0
        public override void OnNewBatchJob()
        {
            RefineingJob newjob = new RefineingJob(NewJobSelectedItem, NewJobBatchCount, _staticData_.ProcessedMaterials[NewJobSelectedItem].RefineryPointCost, NewJobRepeat);

            RefiningProcessor.AddJob(_staticData_, _colonyEntity_, newjob);
            Refresh();
        }
예제 #2
0
        //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);
            }
        }
예제 #3
0
 public void OnComponentInstalation(Entity parentEntity, Entity componentInstance)
 {
     if (!parentEntity.HasDataBlob <RefiningDB>())
     {
         parentEntity.SetDataBlob(new RefiningDB());
     }
     RefiningProcessor.ReCalcRefiningRate(parentEntity);
 }
예제 #4
0
 internal override void ActionCommand(Game game)
 {
     if (!IsRunning)
     {
         RefiningProcessor.AddJob(_staticData, _entityCommanding, _job);
         IsRunning = true;
     }
 }
예제 #5
0
 internal override void ActionCommand(Game game)
 {
     RefiningProcessor.ChangeJobPriority(_entityCommanding, JobID, Delta);
     IsRunning = true;
 }
예제 #6
0
 public void ProcessEntity(Entity entity, int deltaSeconds)
 {
     RefiningProcessor.RefineMaterials(entity, ProcessedMaterials);
 }