I am doing some design work and was wondering what everyone else thought of using exceptions in a game. I am thinking of using them say, for example: if a player tried to equip an item that was not flagged to be equipped it would generate an exception [ItemCannotBeEquippedException]. This seems like an improper use for try and catch statements and exceptions. As an exception is defined as something that hinders the flow of the problem. Though, this hinders the flow, it does not necessary impact it on a way that is a very serve problem (such as an out of bounds exception on an array list). I am used to doing checking myself in if statements. ie: if item not flagged return “Can’t equip this.”
What are your thoughts on this?
Another question I had - what is the performance hit on using try/catch in java? Does anyone have any good articles on that?
Thank you.