Aufruf als
Conditions.group_state.validCompare(value)
Erfassen Sie die Abhängigkeit Conditions.group_state.validCompare und rufen Sie sie dann unter diesem Namen auf. Ein Aufruf über den Namensraum übergibt kein self: Verwenden Sie einen Doppelpunkt-Aufruf oder übergeben Sie das Objekt selbst.
Was sie bewirkt
Checks that a Group Count value carries a known operator and a finite, non-negative number, which is at most 100 when the count is a percent of the group.
Argumente
| Name | Typ | Was sie bewirkt |
|---|---|---|
value | table | The condition value, read for its operator, value and percent fields. |
Rückgabewerte
| 1 | boolean | True when the comparison is valid. |
|---|
Editionen
Integrierte Hilfsfunktionen werden auf jeder Edition registriert. Unterschiedlich ist die Spiel-API, die sie lesen; fehlt eine, weicht die Hilfsfunktion aus oder gibt nil mit einem Grund zurück.
Sie liest keine Spiel-API direkt.
Wie das Addon sie aufruft
- Gruppenzahl (valid)
and validCompare(value)
Abhängigkeiten
Functions.cache.getCached→Functions.cache.getCachedFunctions.presentation.compareString→Functions.presentation.compareStringFunctions.presentation.nullable→Functions.presentation.nullableFunctions.values.compare→Functions.values.compareFunctions.values.isin→Functions.values.isin
Quelle
Conditions/group_state.lua, Zeile 59. Im Spiel schreibgeschützt; Duplizieren erstellt eine bearbeitbare Kopie.
Conditions.group_state.validCompare(value)
if value.operator == nil or not Functions.values.isin(addon.operators, value.operator) then return false end
if type(value.value) ~= "number" or value.value ~= value.value or value.value < 0 or value.value >= math.huge then return false end
return value.percent ~= true or value.value <= 100