I've been reading about the SOLID principle and component-based game development. Lots of these posts explain it but don't really give examples on it.
For example, in a hypothetical RPG game, say there's a player class. The class consists of components like Inventory, Movement, and let's say a Roll component. You make the roll component so the player can use it, that's great and it works for the player. Now say that an enemy has the same roll component, how do you implement it? The enemy won't necessarily have the same animation, same roll distance, etc. Do you make a database with roll animations for different enemies? Do you have an animation variable in the enemy's class specifically for the roll component (even though this seems to break the SOLID principle)? Do you make the enemy class override the roll animation? It's specific things like this that I don't understand how to implement.
Another example of the inventory component. What would be responsible for equipping, dropping, or removing items? Do you put it in the inventory component and create messy code with dependency on knowing the owner of the inventory?
Maybe I'm not understanding SOLID or component based programming properly, I'm not sure.
If anyone has specific examples like this they could explain to me, that would be appreciated.