Exemplo n.º 1
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectMineralProcessingPlant>();

            duration = CraftingDuration.Short;

            inputItems.Add <ItemOreIron>(count: 3);

            outputItems.Add <ItemOreIronConcentrate>(count: 1);
            outputItems.Add <ItemSand>(count: 1);
        }
Exemplo n.º 2
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectCampfire>()
            .Add <ObjectFurnace>()
            .Add <ObjectFurnaceElectric>();

            duration = CraftingDuration.Short;

            inputItems.Add <ItemLogs>(count: 1);

            outputItems.Add <ItemCharcoal>(count: 4);
        }
        protected sealed override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            // all barrels
            stations.AddAll <IProtoObjectBarrel>();

            duration = this.CraftDuration;

            this.inputItem = GetProtoEntity <TInputItem>();
            inputItems.Add(this.inputItem);

            outputItems.Add <TOutputItem>();
        }
Exemplo n.º 4
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectCoinMint>();

            duration = CraftingDuration.VeryShort;

            inputItems.Add <ItemCoinShiny>(count: 5);

            outputItems.Add <ItemCoinPenny>(count: 10);
            outputItems.Add <ItemIngotLithium>(count: 1);
            outputItems.Add <ItemIngotGold>(count: 1);
        }
Exemplo n.º 5
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectCoinMint>();

            duration = CraftingDuration.VeryShort;

            inputItems.Add <ItemCoinPenny>(count: 10);

            outputItems.Add <ItemIngotCopper>(count: 1);
            outputItems.Add <ItemIngotIron>(count: 1);
            outputItems.Add <ItemIngotSteel>(count: 1);
        }
Exemplo n.º 6
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectStove>();
            stations.Add <ObjectStoveElectric>();

            duration = CraftingDuration.Medium;

            inputItems.Add <ItemBottleWaterSalty>(count: 1);

            outputItems.Add <ItemSalt>(count: 2);
            outputItems.Add <ItemBottleEmpty>(count: 1);
        }
Exemplo n.º 7
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectWorkbench>();

            duration = CraftingDuration.Medium;

            inputItems
            .Add <ItemIngotSteel>(count: 10)
            .Add <ItemComponentsMechanical>(count: 1);

            outputItems
            .Add <ItemStructuralPlating>(count: 1);
        }
Exemplo n.º 8
0
        public void AddItem(NodeItem item)
        {
            if (item.Node != null)
            {
                item.Node.RemoveItem(item);
            }
            item.Node = this;

            if (item.ItemType == NodeItemType.Output)
            {
                OutputItems.Add(item);
            }
            else if (item.ItemType == NodeItemType.Input)
            {
                InputItems.Add(item);
            }
        }
Exemplo n.º 9
0
        protected override void SetupRecipe(
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems,
            StationsList optionalStations)
        {
            optionalStations.Add <ObjectWorkbench>();

            duration = CraftingDuration.Second;

            inputItems.Add <ItemBottleEmpty>(count: 1);

            outputItems.Add <ItemGlassRaw>(count: 5);

            this.Icon = ClientItemIconHelper.CreateComposedIcon(
                name: this.Id + "Icon",
                primaryIcon: GetItem <ItemGlassRaw>().Icon,
                secondaryIcon: GetItem <ItemBottleEmpty>().Icon);
        }
Exemplo n.º 10
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectWorkbench>();

            duration = CraftingDuration.Second;

            inputItems.Add <ItemLeaf>(count: 1);

            outputItems.Add <ItemFibers>(count: 3);

            this.Icon = ClientItemIconHelper.CreateComposedIcon(
                name: this.Id + "Icon",
                primaryIcon: GetItem <ItemFibers>().Icon,
                secondaryIcon: GetItem <ItemLeaf>().Icon);
        }
Exemplo n.º 11
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectChemicalLab>();

            duration = CraftingDuration.Second;

            inputItems.Add <ItemComponentsIndustrialChemicals>(count: 1);

            outputItems.Add <ItemGlue>(count: 3);

            this.Icon = ClientItemIconHelper.CreateComposedIcon(
                name: this.Id + "Icon",
                primaryIcon: GetItem <ItemGlue>().Icon,
                secondaryIcon: GetItem <ItemComponentsIndustrialChemicals>().Icon);
        }
Exemplo n.º 12
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectArmorerWorkbench>();

            duration = CraftingDuration.Long;

            inputItems.Add <ItemKeinite>(count: 20);
            inputItems.Add <ItemIngotSteel>(count: 50);
            inputItems.Add <ItemAramidFiber>(count: 20);
            inputItems.Add <ItemComponentsHighTech>(count: 2);
            inputItems.Add <ItemBallisticPlate>(count: 5);
            inputItems.Add <ItemTarpaulin>(count: 20);
            inputItems.Add <ItemGlue>(count: 20);
            inputItems.Add <ItemFur>(count: 50);

            outputItems.Add <ItemBackpackHeavyKeinite>();
        }
Exemplo n.º 13
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectMineralProcessingPlant>();

            duration = CraftingDuration.VeryShort;

            inputItems.Add <ItemStone>(count: 25);

            outputItems.Add <ItemSand>(count: 25);

            this.Icon = ClientItemIconHelper.CreateComposedIcon(
                name: this.Id + "Icon",
                primaryIcon: GetItem <ItemSand>().Icon,
                secondaryIcon: GetItem <ItemStone>().Icon);
        }
Exemplo n.º 14
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan craftDuration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectCookingTable>();

            craftDuration = CraftingDuration.VeryShort;

            inputItems.Add <ItemCorn>(count: 1);

            outputItems.Add <ItemCookingOil>(count: 1);

            this.Icon = ClientItemIconHelper.CreateComposedIcon(
                name: this.Id + "Icon",
                primaryIcon: GetItem <ItemCookingOil>().Icon,
                secondaryIcon: GetItem <ItemCorn>().Icon);
        }
Exemplo n.º 15
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectWorkbench>();

            duration = CraftingDuration.Short;

            inputItems.Add <ItemPlastic>(count: 5);

            outputItems.Add <ItemCanisterEmpty>(count: 5);

            this.Icon = ClientItemIconHelper.CreateComposedIcon(
                name: this.Id + "Icon",
                primaryIcon: GetItem <ItemCanisterEmpty>().Icon,
                secondaryIcon: GetItem <ItemPlastic>().Icon);
        }
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectCampfire>();

            duration = CraftingDuration.Medium;

            inputItems.Add <ItemMushroomPennyBun>(count: 1);

            outputItems.Add <ItemRoastedMushrooms>();

            this.Icon = ClientItemIconHelper.CreateComposedIcon(
                name: this.Id + "Icon",
                primaryIcon: GetItem <ItemRoastedMushrooms>().Icon,
                secondaryIcon: GetItem <ItemMushroomPennyBun>().Icon);
        }
Exemplo n.º 17
0
        protected override void PrepareProtoVehicle(
            InputItems buildRequiredItems,
            InputItems repairStageRequiredItems,
            out int repairStagesCount)
        {
            buildRequiredItems
            .Add <ItemStructuralPlating>(30)
            .Add <ItemUniversalActuator>(8)
            .Add <ItemImpulseEngine>(6)
            .Add <ItemComponentsHighTech>(20);

            repairStageRequiredItems
            .Add <ItemIngotSteel>(10)
            .Add <ItemStructuralPlating>(1)
            .Add <ItemUniversalActuator>(1)
            .Add <ItemComponentsHighTech>(1);

            repairStagesCount = 5;
        }
Exemplo n.º 18
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectCampfire>();
            stations.Add <ObjectStove>();

            duration = CraftingDuration.Medium;

            inputItems.Add <ItemAnimalFat>(count: 2);

            outputItems.Add <ItemCampFuel>();

            this.Icon = ClientItemIconHelper.CreateComposedIcon(
                name: this.Id + "Icon",
                primaryIcon: GetItem <ItemCampFuel>().Icon,
                secondaryIcon: GetItem <ItemAnimalFat>().Icon);
        }
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectFurnace>()
            .Add <ObjectFurnaceElectric>();

            duration = CraftingDuration.Medium;

            inputItems.Add <ItemOreIronConcentrate>(count: 1);

            outputItems.Add <ItemIngotIron>();

            this.Icon = ClientItemIconHelper.CreateComposedIcon(
                name: this.Id + "Icon",
                primaryIcon: GetItem <ItemIngotIron>().Icon,
                secondaryIcon: GetItem <ItemOreIronConcentrate>().Icon);
        }
Exemplo n.º 20
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectWorkbench>();

            duration = CraftingDuration.Medium;

            inputItems
            .Add <ItemIngotSteel>(count: 5)
            .Add <ItemPlastic>(count: 5)
            .Add <ItemCanisterMineralOil>(count: 1)
            .Add <ItemComponentsMechanical>(count: 5);

            outputItems
            .Add <ItemUniversalActuator>(count: 1)
            .Add <ItemCanisterEmpty>(count: 1);
        }
Exemplo n.º 21
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectChemicalLab>();

            duration = CraftingDuration.Medium;

            inputItems.Add <ItemPotassiumNitrate>(count: 50);
            inputItems.Add <ItemSulfurPowder>(count: 50);
            inputItems.Add <ItemOrePyrite>(count: 50);
            inputItems.Add <ItemOreLithium>(count: 25);
            inputItems.Add <ItemSalt>(count: 50);
            inputItems.Add <ItemAsh>(count: 10);
            inputItems.Add <ItemCanisterGasoline>(count: 5);
            inputItems.Add <ItemCanisterMineralOil>(count: 2);

            outputItems.Add <ItemComponentsIndustrialChemicals>(count: 25);
            outputItems.Add <ItemCanisterEmpty>(count: 7);
        }
Exemplo n.º 22
0
        protected override void PrepareProtoVehicle(
            InputItems buildRequiredItems,
            InputItems repairStageRequiredItems,
            out int repairStagesCount)
        {
            buildRequiredItems
            .Add <ItemKeinite>(120)
            .Add <ItemToxin>(120)
            .Add <ItemPragmiumHeart>(3)
            .Add <ItemTyrantHeart>(3)
            .Add <ItemVialBiomaterial>(50);

            repairStagesCount = 0; // this mech has health regeneration and cannot be repaired in any other way

            if (IsServer)
            {
                TriggerEveryFrame.ServerRegister(
                    callback: this.ServerUpdateStructurePointsRegeneration,
                    name: "System." + this.ShortId + ".ArmorRegeneration");
            }
        }
Exemplo n.º 23
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectStove>();
            stations.Add <ObjectStoveElectric>();
            stations.Add <ObjectCampfire>();

            duration = CraftingDuration.Short;

            inputItems.Add <ItemFlowerOni>(count: 1);

            outputItems.Add <ItemAsh>(count: 5);

            this.Icon = ClientItemIconHelper.CreateComposedIcon(
                name: this.Id + "Icon",
                primaryIcon: GetItem <ItemAsh>().Icon,
                secondaryIcon: GetItem <ItemFlowerOni>().Icon);
        }
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectWorkbench>();

            duration = CraftingDuration.Short;

            inputItems.Add <ItemReactorBrokenModule>(count: 5);

            outputItems.Add <ItemComponentsElectronic>(count: 1);
            outputItems.Add <ItemIngotSteel>(count: 5);
            outputItems.Add <ItemWire>(count: 5);

            this.Icon = ClientItemIconHelper.CreateComposedIcon(
                name: this.Id + "Icon",
                primaryIcon: GetItem <ItemComponentsElectronic>().Icon,
                secondaryIcon: GetItem <ItemReactorBrokenModule>().Icon);
        }
Exemplo n.º 25
0
        public async Task Items_Are_Output_In_The_Same_Order_As_They_Are_Input()
        {
            var itemHandler = new ItemHandler();
            var timerEvents = Observable.Timer(TimeSpan.Zero, TimeSpan.FromMilliseconds(250));

            timerEvents.Subscribe(async x => {
                var data = (int)x;
                Console.WriteLine($"Value Produced: {x}");
                var dataAccepted = await itemHandler.SendAsync((int)data);
                if (dataAccepted)
                {
                    InputItems.Add(data);
                }
            });

            await Task.Delay(5000);

            itemHandler.Complete();
            await itemHandler.Completion;

            CollectionAssert.AreEqual(InputItems, itemHandler.OutputValues);
        }
Exemplo n.º 26
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectWorkbench>();

            duration = CraftingDuration.Long;

            inputItems.Add <ItemGlassRaw>(count: 100);
            inputItems.Add <ItemPlastic>(count: 50);
            inputItems.Add <ItemWire>(count: 50);
            inputItems.Add <ItemComponentsOptical>(count: 50);
            inputItems.Add <ItemComponentsElectronic>(count: 40);
            inputItems.Add <ItemOrePragmium>(count: 10);
            inputItems.Add <ItemPowerCell>(count: 5);

            outputItems.Add <ItemSolarPanel>(count: 1);
        }
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectArmorerWorkbench>();

            duration = CraftingDuration.Long;

            inputItems.Add <ItemIngotSteel>(count: 10);
            inputItems.Add <ItemTarpaulin>(count: 20);
            inputItems.Add <ItemThread>(count: 40);
            inputItems.Add <ItemLeather>(count: 10);
            inputItems.Add <ItemRope>(count: 5);
            inputItems.Add <ItemGlue>(count: 10);
            inputItems.Add <ItemFur>(count: 10);

            outputItems.Add <ItemBackpackMilitary>();
        }
Exemplo n.º 28
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan duration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectArmorerWorkbench>();

            duration = CraftingDuration.VeryLong;

            inputItems.Add <ItemIngotGold>(count: 20);
            inputItems.Add <ItemGemDiamond>(count: 1);
            inputItems.Add <ItemGemEmerald>(count: 1);
            inputItems.Add <ItemGemRuby>(count: 1);
            inputItems.Add <ItemGemSapphire>(count: 1);
            inputItems.Add <ItemGemTopaz>(count: 1);
            inputItems.Add <ItemGemTourmaline>(count: 1);

            outputItems.Add <ItemGoldArmor>();
        }
Exemplo n.º 29
0
        protected override void SetupRecipe(
            StationsList stations,
            out TimeSpan craftDuration,
            InputItems inputItems,
            OutputItems outputItems)
        {
            stations.Add <ObjectCookingTable>();

            craftDuration = CraftingDuration.Medium;

            inputItems.Add <ItemBerriesJelly>(count: 5);
            inputItems.Add <ItemSugar>(count: 20);
            inputItems.Add <ItemButter>(count: 1);
            inputItems.Add <ItemCornFlour>(count: 1);
            inputItems.Add <ItemHerbPurple>(count: 1);
            inputItems.Add <ItemHerbRed>(count: 1);
            inputItems.Add <ItemHerbBlue>(count: 1);


            outputItems.Add <ItemJellyBeans>(count: 10);
        }
        public void AddFileList(string[] fileList)
        {
            if (fileList == null)
            {
                return;
            }

            foreach (var filePath in fileList)
            {
                var extension = Path.GetExtension(filePath).Remove(0, 1);

                if (string.IsNullOrEmpty(extension))
                {
                    continue;
                }

                if (!FileTypeFilters.Contains(extension, StringComparer.InvariantCultureIgnoreCase))
                {
                    continue;
                }

                InputItems.Add(new InputItemModel(filePath));
            }
        }