Call as
Conditions.build.wholeNumber(value)
Record the dependency Conditions.build.wholeNumber, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.
What it does
True when value is a positive, finite whole number; SET_PIECES uses it to validate the saved item set ID.
Arguments
| Name | Type | What it does |
|---|---|---|
value | any | Value to check. |
Returns
| 1 | boolean | True when the value passes the check. |
|---|
Editions
Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.
It reads no game API directly.
How the addon calls it
- Item Set Pieces Equipped (valid)
return wholeNumber(value.set) and value.operator ~= nil and Functions.values.isin(addon.operators, value.operator) - Weapon Enchant Type (valid)
return wholeNumber(value.enchant) and (value.offhand == nil or type(value.offhand) == "boolean") Conditions.build.setLabelif not wholeNumber(id) then return nil end
Source
Conditions/build.lua, line 63. Read only in game; Duplicate makes an editable copy.
Conditions.build.wholeNumber(value)
return type(value)=="number" and value>0 and value<math.huge and value%1==0