@Test public void testHelpMessage() { TestHelper.load(); String helpMessage = "move x y\n\tmoves the player to the specified x,y coordinates"; assertEquals(helpMessage, command.execute("help")); }
@Override String execute(Object[] arguments) { player = World.getInstance().getFirstPlayer(); try { float x = Float.parseFloat((String) arguments[0]); float y = Float.parseFloat((String) arguments[1]); return movePlayer(x, y); } catch (NumberFormatException e) { return "Invalid coordinate/s."; } }
MoveCommand extends Command { @Override String execute(Object[] arguments) { player = World.getInstance().getFirstPlayer(); try { float x = Float.parseFloat((String) arguments[0]); float y = Float.parseFloat((String) arguments[1]); return movePlayer(x, y); } catch (NumberFormatException e) { return "Invalid coordinate/s."; } } }
MoveCommand extends Command { @Override String execute(Object[] arguments) { player = World.getInstance().getFirstPlayer(); try { float x = Float.parseFloat((String) arguments[0]); float y = Float.parseFloat((String) arguments[1]); return movePlayer(x, y); } catch (NumberFormatException e) { return "Invalid coordinate/s."; } } MoveCommand(); }
MoveCommand extends Command { @Override String execute(Object[] arguments) { player = World.getInstance().getFirstPlayer(); try { float x = Float.parseFloat((String) arguments[0]); float y = Float.parseFloat((String) arguments[1]); return movePlayer(x, y); } catch (NumberFormatException e) { return "Invalid coordinate/s."; } } MoveCommand();  }
MoveCommand extends Command { @Override String execute(Object[] arguments) { player = World.getInstance().getFirstPlayer(); try { float x = Float.parseFloat((String) arguments[0]); float y = Float.parseFloat((String) arguments[1]); return movePlayer(x, y); } catch (NumberFormatException e) { return "Invalid coordinate/s."; } } MoveCommand();   }