This site requires JavaScript, please enable it in your browser!
Greenfoot back
bleeblob43
bleeblob43 wrote ...

2016/11/12

make act method throw exceptions

bleeblob43 bleeblob43

2016/11/12

#
I'm making a game where there is an inventory class which handles items each item is its own object there is a list of items in the inventory class there are methods that modify the item list these methods throw exceptions this means that whenever I call those methods in another method, the latter method has to throw the exceptions as well I want to use the item list modificatio methods in the act method of other classes, but i can because i cant override the act method. what do i do?
danpost danpost

2016/11/12

#
bleeblob43 wrote...
I'm making a game where there is an inventory class which handles items...I want to use the item list modificatio methods in the act method of other classes, but i can because i cant override the act method. what do i do?
You start by posting the codes you are using -- the Inventory class, any class that creates an Inventory list and any class that uses an Inventory list. Then, you specify where you are having trouble using the list.
bleeblob43 bleeblob43

2016/11/12

#
never mind. I got it working with a try catch statement. Sorry about not posting the code
You need to login to post a reply.