Class LuaConditionHelper
java.lang.Object
games.stendhal.server.core.scripting.lua.LuaConditionHelper
Exposes ChatCondition classes to Lua.
-
Method Summary
Modifier and TypeMethodDescriptionandC(org.luaj.vm2.LuaTable conditionList)
Helper method to create an AndCondition instance.andCondition(org.luaj.vm2.LuaTable conditionList)
Deprecated.Creates an instance of a ChatCondition from the class name string.create(org.luaj.vm2.LuaFunction lf)
Creates a custom ChatCondition.static LuaConditionHelper
get()
Retrieves the static instance.notC(ChatCondition condition)
Creates a NotCondition instance.notC(org.luaj.vm2.LuaValue lv)
Helper method for creating a NotCondition instance.notCondition(ChatCondition condition)
Deprecated.UseLuaConditionHelper.notC
.notCondition(org.luaj.vm2.LuaValue lv)
Deprecated.UseLuaConditionHelper.notC
.orC(org.luaj.vm2.LuaTable conditionList)
Helper method to create an OrCondition instance.
-
Method Details
-
get
Retrieves the static instance.- Returns:
- Static ConditionHelper instance.
-
create
Creates a custom ChatCondition.- Parameters:
lf
- LuaFunction to be invoked when ChatCondition.fire() is called.- Returns:
- New ChatCondition.
-
create
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 ornull
.
-
notC
Creates a NotCondition instance.- Parameters:
condition
- Condition to be checked.- Returns:
- New NotCondition instance.
-
notCondition
Deprecated.UseLuaConditionHelper.notC
.Creates a NotCondition instance.- Parameters:
condition
- Condition to be checked.- Returns:
- New NotCondition instance.
-
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.
-
notCondition
Deprecated.UseLuaConditionHelper.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
Helper method to create an AndCondition instance.- Parameters:
conditionList
- LuaTable containing a list of ChatCondition instances.- Returns:
- New AndCondition instance.
-
andCondition
Deprecated.UseLuaConditionHelper.andC
.Helper method to create an AndCondition instance.- Parameters:
conditionList
- LuaTable containing a list of ChatCondition instances.- Returns:
- New AndCondition instance.
-
orC
Helper method to create an OrCondition instance.- Parameters:
conditionList
- LuaTable containing a list of conditions.- Returns:
- New OrCondition instance or
null
if failed.
-
LuaConditionHelper.andC
.