Package games.stendhal.server.entity.npc
Class ConditionBuilder
java.lang.Object
games.stendhal.server.entity.npc.ConditionBuilder
A builder for combining ChatConditions.
An example combined condition generated with the static factory methods in
ChatConditions.
greetingMatchesName(npc.getName())
.and(questInState(QUEST_SLOT, "start"))
.unless(playerCarriesItem("empty goblet")
.or(playerCarriesItem("goblet")))
.build();
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionand(ConditionBuilder child) Combine the condition represented by this builder with the child using logical AND.build()Build the ChatCondition represented by this builder.or(ConditionBuilder child) Combine the condition represented by this builder with the child using logical OR.unless(ConditionBuilder child) A convenience method for combining the condition represented by this builder with the child using logical AND NOT.
-
Constructor Details
-
ConditionBuilder
Create a new ConditionBuilder. This is meant primarily for the use of the static factory methods in ChatConditions.- Parameters:
condition-
-
-
Method Details
-
and
Combine the condition represented by this builder with the child using logical AND.- Parameters:
child-- Returns:
- the builder itself
- See Also:
-
or
Combine the condition represented by this builder with the child using logical OR.- Parameters:
child-- Returns:
- the builder itself
- See Also:
-
unless
A convenience method for combining the condition represented by this builder with the child using logical AND NOT. This is equivalent tobuilder.and(not(child))which may be more appropriate in some cases.- Parameters:
child-- Returns:
- the builder itself
- See Also:
-
and(ConditionBuilder)NotCondition
-
build
Build the ChatCondition represented by this builder.- Returns:
- a ChatCondition
-