예제 #1
0
/**
 * Get a property value from global test structure
 * @param name Name of the property
 * @return A property value, else 0 if property not found.
 */
long TEST_GetLongProperty (const char* name)
{
	const test_property_t* element = TEST_GetProperty(name);
	if (element == nullptr) {
		Com_Printf("WARNING: Test property \"%s\" not found. 0 returned.\n", name);
		return 0;
	}
	return atol(element->value);
}
예제 #2
0
/**
 * Get a property value from global test structure
 * @param name Name of the property
 * @return A property value, else nullptr if property not found.
 */
const char* TEST_GetStringProperty (const char* name)
{
	const test_property_t* element = TEST_GetProperty(name);
	if (element == nullptr) {
		Com_Printf("WARNING: Test property \"%s\" not found. nullptr returned.\n", name);
		return nullptr;
	}
	return element->value;
}
예제 #3
0
파일: test_shared.c 프로젝트: kevlund/ufoai
/**
 * Get a property value from global test structure
 * @param name Name of the property
 * @return A property value, else 0 if property not found.
 */
int TEST_GetIntProperty (const char* name)
{
	const test_property_t *element = TEST_GetProperty(name);
	if (element == NULL) {
		Com_Printf("WARNING: Test property \"%s\" not found. 0 returned.\n", name);
		return 0;
	}
	return atoi(element->value);
}
예제 #4
0
/**
 * Test if a property from global test structure exists
 * @param name Name of the property
 * @return True if the property exists
 */
bool TEST_ExistsProperty (const char* name)
{
	return TEST_GetProperty(name) != nullptr;
}
예제 #5
0
파일: test_shared.c 프로젝트: kevlund/ufoai
/**
 * Test if a property from global test structure exists
 * @param name Name of the property
 * @return True if the property exists
 */
qboolean TEST_ExistsProperty (const char* name)
{
	return TEST_GetProperty(name) != NULL;
}