mardi 27 avril 2021

Picking out a random class c# [closed]

so my problem is that I have a cooking program. I have several Recipes which consists of several materials. All of them are classes for example (class Egg()). The thing is that I have a Chef class instance and I need to give random materials to my chef. The question is that how do I create instances of a random material (Like a class Egg()).

To get it clearer here's an example: Chef Amy gets random materials like an Egg,Flour,Baking soda etc. So I have multiple material classes and I need to choose randomly from them. I do have a class hierarchy so I have an Ingredient base class, ingredients inherit from this class.

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire