What's up, guys.
I wanted to ask you something.
Imagine a game like Dota 2, or League of Legends, they have like 100+ heroes, right? I was wondering how is every hero instantiated.
1st option: Character shadowFiend = Character( 5, 7, 55, 22, 150, 1300, 20, 35 ).( put 40 arguments in the constructor ).
2nd option: Make a new class for every hero, but then if you have 100 heroes, you need 100 classes. What I meant is, how to deal with Characters that are very different, and when I don't want to pass 30 arguments to the constructor?
3rd option: Character shadowFiend = Character( something );
shadowFiend.setSpeed( 5 );
shadowFiend.setStrength(7);
shadowFiend.setAgility( 12 );
and on and on...
What is the way normal people prefer?
2nd question:
I have a class Character and every character I create needs animations and shaders and a bunch of other stuff.
But the problem is that Blender can't export multiple animations on the same model, that's why I need a new model for every animation, and I store them at my ResourceManager class/object ( it doesn't manage anything, just stores ).
And I don't know how to deal with the animations because they are simply too much.
Should I create a new variable with a different name for every single animation,( I do this now, really bad )
or should I add them all in a vector.
But then if I add 20 animations in a vector, how am I going to remember which one is run, knockdown, attack, die, swim, whatever? Isn't this error-prone?
3rd question: I store all game content in one class called ResourceManager. And I need to pass that content somehow to my characters when I instantiate them. Is it ok to make a few vectors of pointers in the resourceManager class, so I can pass just the vectors. For example all the animations for Hero1, are in a vector<Anim*> Hero1Anims. So basically, I group the addresses of all common animations in one vector in order to pass them somewhere? Is this the best way?
4th question: My class character works with the same shaders for ALLL characters. Is there a way where I can access the resourceManager, get the needed shaders and just instantiate them in the header file of the Character class, instead of passing the same shaders every time to the Character's constructor. Should I make my resource manager global, can you suggest the easiest way you can think of?
Any help is appreciated, if you don't understand anything, just ask, I'll try to clarify.
Thanks for taking the time to read all that messed up stuff. ^_^