Chame como
Platform.casting.finite(value)
Registre a dependência Platform.casting.finite 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 number that is neither NaN nor infinite, and false for anything else. Negative numbers, zero and fractions count as finite.
Argumentos
| Nome | Tipo | O que faz |
|---|---|---|
value | any | Value to test. |
Retornos
| 1 | boolean | True when value is a finite number; false otherwise. |
|---|
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.casting.durationSecondsif not finite(starting) or not finite(ending) or starting<0 or ending<=starting then return nil,'invalid-api-result' endPlatform.casting.remainingSecondsif not finite(ending) or ending<0 then return nil,'invalid-api-result' end
Código-fonte
Platform/casting.lua, linha 15. Somente leitura no jogo; Duplicar cria uma cópia editável.
Platform.casting.finite(value)
return type(value)=='number' and value==value and value<math.huge and value>-math.huge