Exemplo n.º 1
0
 public InventoriesGroomer(GridManager gridManager, ContainerManager contManager, AssemblerManager assemblerManager,
                           MiscInventoryManager miscInventoryManager, RefineryManager refineryManager, IProcessSpawner spawner, Action <string> logger)
 {
     this.logger             = logger;
     this._outputInventories = new List <IOutputInventoryCollection> {
         assemblerManager, miscInventoryManager, refineryManager
     };
     spawner.Spawn(p => this._groomContainers(contManager), "container-groomer", period: 100);
     spawner.Spawn(p => this.groomOutputInventories(gridManager, contManager), "producer-groomer", period: 47);
 }
Exemplo n.º 2
0
        public Program()
        {
            this.Runtime.UpdateFrequency = UpdateFrequency.Update1;
            this.manager = Process.CreateManager(this.Echo);
            var logger = new Logger(this.manager, this.Me.GetSurface(0), echo: this.Echo);

            this.command = new CommandLine("Inventory Manager", logger.Log, this.manager);

            int counter = 0;
            var ini     = new MyIni();

            ini.TryParse(this.Me.CustomData);

            this.manager.Spawn(p => this.gridManager          = new GridManager(this, ini, this.manager, logger.Log), "gm-init", period: ++counter, useOnce: true);
            this.manager.Spawn(p => this.containerManager     = new ContainerManager(this.GridTerminalSystem, this.gridManager, this.manager, logger.Log), "cm-init", period: ++counter, useOnce: true);
            this.manager.Spawn(p => this.assemblerManager     = new AssemblerManager(this.GridTerminalSystem, this.gridManager, this.manager), "am-init", period: ++counter, useOnce: true);
            this.manager.Spawn(p => this.refineryManager      = new RefineryManager(this.GridTerminalSystem, this.gridManager, this.manager), "rm-init", period: ++counter, useOnce: true);
            this.manager.Spawn(p => this.miscInventoryManager = new MiscInventoryManager(this.GridTerminalSystem, this.gridManager, this.manager, logger.Log), "mim-init", period: ++counter, useOnce: true);
            this.manager.Spawn(p => new InventoriesGroomer(this.gridManager, this.containerManager, this.assemblerManager,
                                                           this.miscInventoryManager, this.refineryManager, this.manager, logger.Log), "ig-init", period: ++counter, useOnce: true);
        }