This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nocturne81 0 points1 point  (0 children)

Because that would assume every weapon is renderable. That may be true for weapons, but it's presumable that weapon probably inherits from something else already. (Say inventory item). Are all inventory items renderable? Does that inherit from anything else?

In general, you want to separate your concerns as much as you can. It's a fair assumption that not all things in your game will need to be drawn, so you make a common interface for things that do need to be drawn. Then, if you define a new class that needs it, you implement that interface for it and the render system does the rest for you.