Llamar como
Platform.casting.finite(value)
Registra la dependencia Platform.casting.finite y luego llámala con ese nombre. Una llamada con espacio de nombres no pasa self: usa una llamada con dos puntos o pasa tú mismo el objeto.
Qué hace
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
| Nombre | Tipo | Qué hace |
|---|---|---|
value | any | Value to test. |
Retornos
| 1 | boolean | True when value is a finite number; false otherwise. |
|---|
Ediciones
Las funciones auxiliares integradas se registran en todas las ediciones. Lo que cambia es la API del juego que leen; donde falta alguna, la función auxiliar recurre a una alternativa o devuelve nil con un motivo.
No lee directamente ninguna API del juego.
Cómo la llama el addon
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 fuente
Platform/casting.lua, línea 15. Solo lectura en el juego; Duplicar crea una copia editable.
Platform.casting.finite(value)
return type(value)=='number' and value==value and value<math.huge and value>-math.huge