How to iterate all classes in a name space ?
Hi, thank you for your time.
Another name space
MonoGame
is using the name space GameName
as showed on the picture.
My idea is that MonoGame
take each class in GameName
and runs the code in it.
is it possible ?
also bonus question : how a program can ignore the fact that something doesn't exist ?13 Replies
I fact, i want to make my own little engine based on monogame
but i don't realy know the right way to do it.
ooof you chose quite the project for being a beginner...
have the classes inherit from a baseclass usually called gameobject that provides a baseline for you classes..
then put all instances in a list and interate over them
yep, but i don't want to do it each time i create a new script.
Wouldn't there be something to auto-reference objects ?
a properly programmed baseclass requires new classes just to add
: GameObject
thats interesting, but i don't know how parent classes works
well time to learn what inheritance and polymorphism is
i don't want you to lose more time. Any youtube video or doc about it ?
sadly no, but i guess others can recommend sources
Microsoft Visual C# Step by Step, 10th Edition, or newer.
Read the book, doing the exercises for each chapter. Proceed to the next chapter once you understood the previous one. Don't skip. One by one, like a good student 😉
Wow so usefull
sarcasm?
no at all, i learned a lot of things
did you learn enough so that you now can solve the initial problem or do you still need some pointers?