Chame como
Platform.glyphs.integer(value, minimum)
Registre a dependência Platform.glyphs.integer e depois chame-a por esse nome. Uma chamada com namespace não passa self: use uma chamada com dois-pontos ou passe o objeto você mesmo.
O que faz
Returns true when value is a finite whole number no smaller than minimum, and false for anything else (including NaN and infinity).
Argumentos
| Nome | Tipo | O que faz |
|---|---|---|
value | any | Value to test. |
minimum | number | Smallest accepted value. |
Retornos
| 1 | boolean | True when value is an integer of at least minimum. |
|---|
Edições
As funções auxiliares integradas são registradas em todas as edições. O que muda é a API do jogo que elas leem; quando uma está ausente, a função auxiliar recorre a uma alternativa ou retorna nil com um motivo.
Não lê nenhuma API do jogo diretamente.
Como o addon a chama
Platform.glyphs.GetGlyphItemInfoif not integer(itemID,1) then return nil,'invalid-item' endPlatform.glyphs.GetGlyphSocketSnapshotif not integer(count,0) or count>64 then return nil,'invalid-api-result' endPlatform.glyphs.socketif not integer(kind,1) or enabled~=nil and type(enabled)~='boolean' then return {slot=index,reason='invalid-api-result'} end
Código-fonte
Platform/glyphs.lua, linha 16. Somente leitura no jogo; Duplicar cria uma cópia editável.
Platform.glyphs.integer(value, minimum)
return type(value)=='number' and value==value and value>=minimum and value<math.huge and value%1==0