SuperTuxKart
Loading...
Searching...
No Matches
Functions
Collaboration diagram for Utils:

Functions

std::string Utils::insertValues (std::string *format_string, std::string *arg1)
 Replaces placeholders with values.
 
std::string Utils::insertValues (std::string *format_string, std::string *arg1, std::string *arg2)
 Replaces placeholders with values.
 
std::string Utils::insertValues (std::string *format_string, std::string *arg1, std::string *arg2, std::string *arg3)
 Replaces placeholders with values.
 
std::string Utils::insertValues (std::string *format_string, std::string *arg1, std::string *arg2, std::string *arg3, std::string *arg4)
 Replaces placeholders with values.
 
void Utils::runScript (const std::string *str)
 Runs the script function specified by the given string.
 
int Utils::randomInt (int min, int maxExclusive)
 Generate a random integer value.
 
float Utils::randomFloat (int min, int maxExclusive)
 Generate a random floating-point value.
 
void Utils::setTimeout (const std::string *callback_name, float delay)
 Call a function after the specified delay.
 
void Utils::setTimeoutDelegate (asIScriptFunction *obj, float delay)
 Call a method from the given object after the specified delay.
 
void Utils::logInfo (std::string *log)
 Log to the console.
 
void Utils::logWarning (std::string *log)
 Log warning to the console.
 
void Utils::logError (std::string *log)
 Log error to the console.
 
CScriptArrayUtils::sha256 (std::string *input)
 Return a sha256 checksum of string in an array of integers of size 32.
 
std::string Utils::toHex (uint64_t num)
 
bool Utils::isNetworking ()
 
int Utils::versionToInt (const std::string *version)
 
std::string Utils::getSTKVersion ()
 

Detailed Description

Function Documentation

◆ insertValues() [1/4]

std::string Utils::insertValues ( std::string *  format_string,
std::string *  arg1 
)

Replaces placeholders with values.

Note, in angelscript, omit the trailing number. e.g. Utils::insertValues("Hello %s !", "world");

◆ insertValues() [2/4]

std::string Utils::insertValues ( std::string *  format_string,
std::string *  arg1,
std::string *  arg2 
)

Replaces placeholders with values.

Note, in angelscript, omit the trailing number. e.g. Utils::insertValues("Hello %s %s !", "John", "Doe");

◆ insertValues() [3/4]

std::string Utils::insertValues ( std::string *  format_string,
std::string *  arg1,
std::string *  arg2,
std::string *  arg3 
)

Replaces placeholders with values.

Note, in angelscript, omit the trailing number. e.g. Utils::insertValues("Hello %s %s %s !", "Mr", "John", "Doe");

◆ insertValues() [4/4]

std::string Utils::insertValues ( std::string *  format_string,
std::string *  arg1,
std::string *  arg2,
std::string *  arg3,
std::string *  arg4 
)

Replaces placeholders with values.

Note, in angelscript, omit the trailing number. e.g. Utils::insertValues("%s %s %s %s !", "Hello", "Mr", "John", "Doe");