/* * This file is part of the Illarion project. * * Copyright © 2015 - Illarion e.V. * * Illarion is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Illarion is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ package illarion.easynpc.parsed.talk.consequences; import illarion.easynpc.parsed.talk.TalkConsequence; import illarion.easynpc.writer.LuaRequireTable; import illarion.easynpc.writer.LuaWriter; import javax.annotation.Nonnull; import java.io.IOException; import java.io.Writer; /** * @author Martin Karing <nitram@illarion.org> */ public class ConsequenceRepair implements TalkConsequence { @Nonnull @Override public String getLuaModule() { return BASE_LUA_MODULE + "repair"; } @Override public void writeLua(@Nonnull Writer target, @Nonnull LuaRequireTable requires) throws IOException { target.write("talkEntry:addConsequence(" + requires.getStorage(getLuaModule()) + "())"); target.write(LuaWriter.NL); } }