Petr
❔ Variables from different classes not adding up 2
Thats exactly what i want. Sadly multiple inheritance isn't supported in c#, so i have to found another way.
Yes that sounds very good actually, it would simplify the code a lot. I'm not ready to use enums yet (not sure how they work).
But yes, player (YourCharacter) is supposed to be a combination of Race and Class, in terms of stats and functions. And even though im referencing the classes and creating objects of all races, Race's variables and functions aren't visible, and i know i've done it wrong.
36 replies
❔ Variables from different classes not adding up 2
Actually, i have one more question. VasePostava (YourCharacter) should be combination of Rasa (Race/Specie) and Povolani (Class, as warrior, mage...) So in this snippet, i tried to make YourCharacters stats equal to the stats of chosen Race. I would like to then make that stat with the Class (warrior etc.) stats. So YourCharacter would be combination of Class and Race. Does that still work with your solution, or do i need to adjust something else? Thanks.
36 replies
✅ Variables from different classes not adding up
I think i understand a little bit. Since hodnotaBrneni is part of Latkova, and is a static variable, i thought that i dont need to create an instance of Latkova object, since the variable belongs to the class itself, if you know what i mean. Is there any solution? Thanks for hearing me out.
10 replies