I just was looking for some one to shoot these ideas with, someone with more knowledge then me :P.
In my swing text based game I want to have a inventory system the player can use to well use items.
I’m wondering if these ideas are good, bad, or just ugly.
(MVC pattern in use…sorta)
Controller gets Inventory from player
Controller Gets each item from an ArrayList in the inventory
for each item create a button though a “dynamic” button maker in the view class
view returns the button to have controller add an actionlistener
actionListener calls the appropriate method in the player class to use the item
controller returns to state prior to using the items though Enum gameState
I hope that isnt too bad looking.
My issue with this is that this means each and every item would need an actionListener inside the controller class. Is that normal or is there a better way.
…I thought I might have more in my head or on paper but I don’t. I feel there has to be a better way… Any help is appreciate and welcome. So thank-you.