Guest User

Untitled

a guest
May 24th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. public void execute(Game game, String string) {
  2. Item item = game.getCurrentRoom().getItem(string);
  3. if(item != null){
  4. if(item instanceof Openable) {
  5. Openable itm = (Openable) item;
  6. itm.open();
  7. } else { game.getUI().println("Tento predmet sa neda otvorit");}
  8. } else {
  9. game.getUI().println("Taky predmet tu nikde nevidim");
  10. }
  11. }
  12.  
  13.  
  14. chybu vyhadzuje itm.open();
  15.  
  16. method open in interface items.Openable cannot be applied to given types
  17. required: textgame.UserInterface
  18. found: no arguments
Add Comment
Please, Sign In to add comment