1 /* $Id$ */ 2 /*************************************************************************** 3 * (C) Copyright 2003-2011 - Stendhal * 4 *************************************************************************** 5 *************************************************************************** 6 * * 7 * This program is free software; you can redistribute it and/or modify * 8 * it under the terms of the GNU General Public License as published by * 9 * the Free Software Foundation; either version 2 of the License, or * 10 * (at your option) any later version. * 11 * * 12 ***************************************************************************/ 13 package games.stendhal.server.entity.npc.action; 14 15 import games.stendhal.common.grammar.ItemParserResult; 16 import games.stendhal.common.parser.Sentence; 17 import games.stendhal.server.core.config.annotations.Dev; 18 import games.stendhal.server.core.config.annotations.Dev.Category; 19 import games.stendhal.server.entity.npc.EventRaiser; 20 import games.stendhal.server.entity.npc.behaviour.impl.ProducerBehaviour; 21 import games.stendhal.server.entity.player.Player; 22 23 /** 24 * BehaviourAction handles ProducerBehaviour requests. 25 */ 26 @Dev(category=Category.IGNORE) 27 public abstract class ProducerBehaviourAction extends AbstractBehaviourAction<ProducerBehaviour> { 28 ProducerBehaviourAction(final ProducerBehaviour behaviour)29 public ProducerBehaviourAction(final ProducerBehaviour behaviour) { 30 this(behaviour, "produce"); 31 } 32 ProducerBehaviourAction(final ProducerBehaviour behaviour, String npcAction)33 public ProducerBehaviourAction(final ProducerBehaviour behaviour, String npcAction) { 34 super(behaviour, behaviour.getProductionActivity(), npcAction); 35 } 36 37 @Override fireRequestError(final ItemParserResult res, final Player player, final Sentence sentence, final EventRaiser raiser)38 public void fireRequestError(final ItemParserResult res, final Player player, final Sentence sentence, final EventRaiser raiser) { 39 raiser.say(behaviour.getErrormessage(res, npcAction)); 40 } 41 42 @Override toString()43 public String toString() { 44 return "ProducerBehaviourAction"; 45 } 46 47 48 } 49