Shillelagh
❔ Create new instance of type unknown at runtime?
Nice. Yes what I have going on is very similar. My previous version used a class in place of an enum (since different reagents have special properties) but was otherwise identical. Previously all combining was done in an addreagent method as well, but I never made on for the slightly newer version
34 replies
❔ Create new instance of type unknown at runtime?
Wondering as well if there was another way. In reality I have a reagent clasd which stores properties of the reagent including amount. When I move reagent from one container to another I need to remove the correct quantity from one container (changing its amount variable) and then add a new reagent instance of whatever type the reagent instance is from the first container, set the amount properly and store it I another container
34 replies