@Override public void execute(Hero hero, String action) { if (action.equals(AC_PLANT)) { hero.spend(TIME_TO_PLANT); hero.busy(); ((Seed) detach(hero.belongings.backpack)).onThrow(hero.pos); hero.getSprite().operate(hero.pos); } else if (action.equals(Food.AC_EAT)) { detach(hero.belongings.backpack); hero.getSprite().operate(hero.pos); hero.busy(); SpellSprite.show(hero, SpellSprite.FOOD); Sample.INSTANCE.play(Assets.SND_EAT); hero.spend(Food.TIME_TO_EAT); } super.execute(hero, action); }
public void spendAndNext(float time) { busy(); spend(time); next(); }