Chiamala come
Platform.health_forecast.providerValue(self, value)
Registra la dipendenza Platform.health_forecast.providerValue, poi chiamala con quel nome. Una chiamata con spazio dei nomi non passa self: usa una chiamata con i due punti o passa tu l'oggetto.
Cosa fa
Normalizes one health figure returned by the RealMobHealth provider. Returns the value when it is a readable finite nonnegative number, nil with no reason when it is nil or false (the provider has no figure, so native health can be used instead), or nil with "restricted-value" or "invalid-api-result".
Argomenti
| Nome | Tipo | Cosa fa |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (normally addon.Platform), used for its CanReadValue check. |
value | any | Current or maximum health value from RealMobHealth.GetUnitHealth. |
Valori restituiti
| 1 | number | nil | Finite nonnegative health value, or nil when absent or unavailable. |
|---|---|---|
| 2 | string | nil | Reason when the value is unusable; nil when it is valid or simply absent. |
Edizioni
Le funzioni di supporto integrate sono registrate su ogni edizione. Ciò che cambia è l'API di gioco che leggono; dove ne manca una, la funzione di supporto ripiega su un'alternativa o restituisce nil con un motivo.
- Non disponibile su quell'edizione (il motivo è nel suggerimento)
- Solo mentre sono attivi i ripieghi di Blizzard per le API deprecate
| API di gioco | |||||
|---|---|---|---|---|---|
canaccessvalue |
Valori segreti (Retail e Forever)
Su Retail e Forever il gioco fornisce agli addon valori segreti. Questa funzione di supporto controlla ciò che legge (addon.Platform:CanReadValue) e restituisce nil con un motivo come restricted-value invece di un valore segreto che non può confrontare. Considera nil come non disponibile, non come false.
Come la chiama l'addon
Platform.health_forecast.GetHealthForecastProviderObservationlocal value,reason=providerValue(self,current)
Dipendenze
finite→Platform.health_forecast.finite
Sorgente
Platform/health_forecast.lua, riga 40. Nel gioco è in sola lettura; Duplica crea una copia modificabile.
Platform.health_forecast.providerValue(self, value)
if not self:CanReadValue(value) then return nil,'restricted-value' end
if canaccessvalue and not canaccessvalue(value) then return nil,'restricted-value' end
if value==nil or value==false then return nil end
if not finite(value) or value<0 then return nil,'invalid-api-result' end
return value




