In RPG games, people carry items and move around in maps. Different items have different functions. If it is so simple, the use of items can become a method of items, use the item to call this method.
It's terrible. When different people use the same item, the effects are different.
At this time, do I need to put this method into the item object?
It may also be okay. Oo analysis will start to talk about non-human nonsense: if the user parameter is added to a method call, the item knows who is using it, therefore, different processing methods can be performed based on different users.
An item that sells pots actually lives. It becomes an Genie and knows who is using it.
Okay, that's all right. But the problem is that, as an item, it must know the user type for different processing purposes, and coupling is generated, even if you abstract a public interface, coupling still exists, but the processing will be slightly more comfortable.
Someone tried to change this coupling and added the method of using items to the character object, but it was just a matter of ignoring the hacker's practice. The coupling here is lost and will come out in another place. However, experienced designers will know this in advance and weigh the advantages and disadvantages of different methods. For systems of different nature, different processing methods are used.
What should I do if I add another one, that is, the scenario, for example, the ground playing is different from the ground playing is different, and the ground playing is different from the palace using it?
Ask the ox in the garden to tell me how to solve this problem OOAD?