This question already has an answer here:
- Law of Demeter and its applicability 2 answers
I am working on a game, and I have many instances where I have to do something like this:
This gets long to write and not as readable.
I could have a class with a short name that has a bunch of static methods which are shorthand for returning these. But this doesn't "feel right".
I could do as this question suggests, but I really don't like this, and the accepted answer also says this is a bad idea.
Are there any other ways of dealing with this? Should I use method 1, or just keep doing what I'm doing?
EDIT: I could see the question I referenced being marked as a duplicate. It doesn't answer my question, it simply says "don't do that." Also, my method chains are quite a bit longer.