Best way to store a lot of data by script

Hi there!

I am making a kinda Age of Empires game.(I know this is too big for me but nvm) and I would like to store the data of all the different units inside of a script. The point is that most of the units can be made by most of the civilizations but not all units can be made by all civilizations. Also I would like to store the sprites in this script, but eacht civilization should have a different sprite for maybe the same units. For example: I would like to have a Turkish worker with a different sprite as a Roman worker.

Should I use structs or classes? And should I do this in 1 class of just in 1 struct?
I think I should prefer the class because of the cheap data usage but I’m not an expert. :stuck_out_tongue:
And would it be smart to use the Resources folder for this?

Any help is appreciated!

PS: C# plz

I would create a class ‘Unit’ with the basic abilities and functions (like moving)

from ‘Unit’ inherit from there the classes ‘Worker’, ‘CombatUnit’ with their unique stats and stuff

from ‘CombatUnit’ inherit the archers and melee, catapults and whatever you want with their difenrences (like range, AOE and whatever)

And from each individual unity inherit the specific unit of each civ which defer in sprite basically.

learn about C# inheritance rules first.

It basically means that if you inherit class B from class A - or class B extends A,
then B is some kind of A.

To make it more clear, all units are some kind of ‘Unit’
So when you do Class Worker extends Unit you actually gave worker all the characteristics f Unit w/o writing all the code twice.

Then ‘Class TurkishWorker extends Worker’ cause Turkish worker is some kind of worker and has the worker’s ability.
The final results are the complete unit and not an abstact representation of what you want the unit to do (there is no general unit appearing in the game or general worker), so they are finally able to receive the sprite that allow them to look - while still holding all the abilities of their ancestors: Worker and Unit.

hope it helps