I think it is perfectly fine use inheritance if your only plan on having 3 or so subclasses.
ReligiousSpaceship would be fine, but what if six months from now you decide to add 3 more types of ships? What a hassle it would be having to create another class for each new type of ship. Other worse extensibility problems might also come up if you need to extend the hierarchy. For instance, suppose a new type of ship (say a
CivilianFreighterShip) could use some of the functionality of
AttackSpaceship and some functionality of
ResearchSpaceship, but most of the functionality provided by those classes would be misplaces in it (i.e. it shouldn't have attack capabilities but it has a few sensors and shields). Then your options would be to either duplicating code and functionality or sprinkling a bunch of
if tests on the parent classes to enable/disable features so that your
CivilianFreighterShip can inherit from them.
So if you aim on making your code more flexible and extensible, which other approaches to take? You could make your space ships configurable. If you think about it, a space ship that can attack doesn't have to be an
AttackSpaceship class, it just has to have weapons attached to its hull, right? So why not have a single
SpaceShip class having an array of
Weapons? The is a relationship so common in OOP languages is very overused in places a simple component would be a much simpler an flexible solution.
I should reiterate that if you have a static hierarchy that is not meant to grow, then plain inheritance is fine and might even be simpler and cleaner that components and configuration parameters, however, if the goal if flexibility and extensibility, then a component-based approach will produce much better and saner code.
References you should read before making your decision:
Do a search for "components based architecture" and you should find a lot more.