My friend and I are building a mobile game and ran into the following design problem:
We will have many different types of units all with different stats and abilities. However, all unit types should have a few commonalities (for example, they would all have a totalhealth attribute).
We were trying to decide what the best way of representing these units would be.
My friend suggested simply making a new class for each unit type.
I feel that having hundreds of different classes feels wrong, but can't quite figure out what's so bad about it.
My alternative is to put the unit type information into either configuration files or a database (which will also solve the issue of enforcing every unit type to have a few common attributes with a schema). And then have a master unit class to instantiate types of units from the db.
What is the proper way of architecturing this?