Hi, I would like to know how to practice the single responsibility principle.
My first thought is that I should seperate Data and the functions that manipulate them, so that each manipulation requires its own class. But that seems counter intuitive since in OOP, a class has all the methods to manipulate its own members.
Lets take an "Entity class".
Now, we suddenly have a class which does alot of things, but the single responsibility principle says that the class should do only one thing.
How then do we practice the single responsibility principle in this example?
My guess is that all the methods are taken out and the members are made public. We have an array of Entities that has to go through a Move class, a Shoot class, a TakeDamage class and so on. But that seems wrong, it just makes the code more complex.
What is appropiate to have in the Entity class with respect to the single responsibility principle? Should helper functions or other class methods manipulate the Entity members?