Class LuaConditionHelper

java.lang.Object
games.stendhal.server.core.scripting.lua.LuaConditionHelper

public class LuaConditionHelper extends Object
Exposes ChatCondition classes to Lua.
  • Method Details

    • get

      public static LuaConditionHelper get()
      Retrieves the static instance.
      Returns:
      Static ConditionHelper instance.
    • create

      public ChatCondition create(org.luaj.vm2.LuaFunction lf)
      Creates a custom ChatCondition.
      Parameters:
      lf - LuaFunction to be invoked when ChatCondition.fire() is called.
      Returns:
      New ChatCondition.
    • create

      public ChatCondition create(String className, org.luaj.vm2.LuaTable args)
      Creates an instance of a ChatCondition from the class name string.
      Parameters:
      className - Class basename.
      args - Lua table of objects that should be passed to the constructor.
      Returns:
      New ChatCondition instance or null.
    • notC

      public NotCondition notC(ChatCondition condition)
      Creates a NotCondition instance.
      Parameters:
      condition - Condition to be checked.
      Returns:
      New NotCondition instance.
    • notCondition

      @Deprecated public NotCondition notCondition(ChatCondition condition)
      Deprecated.
      Use LuaConditionHelper.notC.
      Creates a NotCondition instance.
      Parameters:
      condition - Condition to be checked.
      Returns:
      New NotCondition instance.
    • notC

      public NotCondition notC(org.luaj.vm2.LuaValue lv)
      Helper method for creating a NotCondition instance.
      Parameters:
      lv - Condition to be checked inside a LuaValue instance, a list of conditions inside a LuaTable, or a LuaFunction that returns a boolean value.
      Returns:
      New NotCondition instance.
    • notCondition

      @Deprecated public NotCondition notCondition(org.luaj.vm2.LuaValue lv)
      Deprecated.
      Use LuaConditionHelper.notC.
      Helper method for creating a NotCondition instance.
      Parameters:
      lv - Condition to be checked inside a LuaValue instance, a list of conditions inside a LuaTable, or a LuaFunction that returns a boolean value.
      Returns:
      New NotCondition instance.
    • andC

      public AndCondition andC(org.luaj.vm2.LuaTable conditionList)
      Helper method to create an AndCondition instance.
      Parameters:
      conditionList - LuaTable containing a list of ChatCondition instances.
      Returns:
      New AndCondition instance.
    • andCondition

      @Deprecated public AndCondition andCondition(org.luaj.vm2.LuaTable conditionList)
      Deprecated.
      Use LuaConditionHelper.andC.
      Helper method to create an AndCondition instance.
      Parameters:
      conditionList - LuaTable containing a list of ChatCondition instances.
      Returns:
      New AndCondition instance.
    • orC

      public OrCondition orC(org.luaj.vm2.LuaTable conditionList)
      Helper method to create an OrCondition instance.
      Parameters:
      conditionList - LuaTable containing a list of conditions.
      Returns:
      New OrCondition instance or null if failed.