Project-RimFactory-Revived icon indicating copy to clipboard operation
Project-RimFactory-Revived copied to clipboard

(Request) Custom Miner with Bill is not possible

Open edho08 opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. This feature request is made because its currently imposible to make another miner building with bills beside the PRF_BillTypeMiner_I building. This problem is caused by the C# code only adding bills to PRF_BillTypeMiner_I instead of Thing with ThingClass of ProjectRimFactory.AutoMachineTool.Building_Miner.

Describe the solution you'd like Consider refactoring the code of static constructor RecipeRegister to query all Thing with ThingClass of ProjectRimFactory.AutoMachineTool.Building_Miner then add their corresponding recipe (with ore exclusion).

Perhaps something like this?


        static RecipeRegister()
        {
            DefDatabase<ThingDef>.AllDefs.Where(d => d.thingClass == typeof(Building_Miner)).ToList().ForEach(thingDef=> registerRecipe(thingDef));
        }

        private static void registerRecipe(ThingDef minerDef)
        {
                ..The devil lies here.
        }

Describe alternatives you've considered perhaps another thing can come in mind.

Additional context

edho08 avatar Jan 17 '22 01:01 edho08

Seems like a good Idea to remove that hardcoded reference.

I am assuming you ask for that change as plan an creating a mod that uses it. if so would you need additional controls to determine the available recipes or is it fine as is?

Sn1p3rr3c0n avatar Jan 19 '22 15:01 Sn1p3rr3c0n