I have a class called Flamethrower which naturally has its own ammunition that is distinct from other weapons. Should this ammunition be a nested class within flamethrower as only flamethrower will ever use this class?
I have a class called Flamethrower which naturally has its own ammunition that is
Share
I’m going to delete my comment and make this an answer:
I don’t think so, the reason being that the ammunition will interact with the target as well, and so its effects are felt beyond that of its host weapon. I usually reserve inner classes for “helper” classes that are used only inside of the outer class.