NSClient: add `void SetInfoKeyFloat(string, float)` and `float GetInfoKeyFloat(string)` methods

This commit is contained in:
Marco Cawthorne 2024-01-29 16:10:16 -08:00
parent 4a8f4a6082
commit 08cac51d5f
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
2 changed files with 17 additions and 0 deletions

View File

@ -71,6 +71,11 @@ public:
/** Get the string value of an InfoKey. */
nonvirtual string GetInfoKey(string);
/** Floating point based version of SetInfoKey(). */
nonvirtual void SetInfoKeyFloat(string, float);
/** Floating point based version of GetInfoKey(). */
nonvirtual float GetInfoKeyFloat(string);
/* overrides */
virtual void Save(float);
virtual void Restore(string,string);

View File

@ -75,6 +75,18 @@ NSClient::GetInfoKey(string strKey)
return infokey(this, strKey);
}
void
NSClient::SetInfoKeyFloat(string strKey, float floatValue)
{
forceinfokey(this, strKey, ftos(floatValue));
}
float
NSClient::GetInfoKeyFloat(string strKey)
{
return infokeyf(this, strKey);
}
#endif
void