示例#1
0
文件: data.cpp 项目: BG1/warzone2100
/* Load the body stats */
static bool bufferSBODYLoad(const char* fileName, void** ppData)
{
	if (!loadBodyStats(fileName) || !allocComponentList(COMP_BODY, numBodyStats))
	{
		return false;
	}
	*ppData = (void *)1;
	return true;
}
示例#2
0
/* Load the Brain stats */
static bool bufferSBRAINLoad(const char *fileName, void **ppData)
{
	if (!loadBrainStats(fileName) || !allocComponentList(COMP_BRAIN, numBrainStats))
	{
		return false;
	}
	//not interested in this value
	*ppData = NULL;
	return true;
}
示例#3
0
/* Load the Repair stats */
static bool bufferSREPAIRLoad(const char *fileName, void **ppData)
{
	if (!loadRepairStats(fileName) || !allocComponentList(COMP_REPAIRUNIT, numRepairStats))
	{
		return false;
	}

	//not interested in this value
	*ppData = NULL;
	return true;
}
示例#4
0
/* Load the Propulsion stats */
static bool bufferSPROPLoad(const char* fileName, void** ppData)
{
	if (!loadPropulsionStats(fileName) || !allocComponentList(COMP_PROPULSION, numPropulsionStats))
	{
		return false;
	}

	//not interested in this value
	*ppData = (void *)1;
	return true;
}
示例#5
0
/* Load the body stats */
static bool bufferSBODYLoad(const char *fileName, void **ppData)
{
	WzConfig ini(fileName, WzConfig::ReadOnlyAndRequired);
	calcDataHash(ini, DATA_SBODY);

	if (!loadBodyStats(ini) || !allocComponentList(COMP_BODY, numBodyStats))
	{
		return false;
	}
	*ppData = (void *)1;
	return true;
}
示例#6
0
static bool bufferSSENSORLoad(const char *fileName, void **ppData)
{
	if (!loadSensorStats(fileName)
	 || !allocComponentList(COMP_SENSOR, numSensorStats))
	{
	        return false;
	}

	//not interested in this value
	*ppData = NULL;
	return true;
}
示例#7
0
/* Load the constructor stats */
static bool bufferSCONSTRLoad(const char *fileName, void **ppData)
{
	if (!loadConstructStats(fileName)
	 || !allocComponentList(COMP_CONSTRUCT, numConstructStats))
	{
		return false;
	}

	//not interested in this value
	*ppData = NULL;
	return true;
}
示例#8
0
/* Load the Brain stats */
static bool bufferSBRAINLoad(const char *fileName, void **ppData)
{
	WzConfig ini(fileName, WzConfig::ReadOnlyAndRequired);
	calcDataHash(ini, DATA_SBRAIN);

	if (!loadBrainStats(ini) || !allocComponentList(COMP_BRAIN, numBrainStats))
	{
		return false;
	}
	//not interested in this value
	*ppData = nullptr;
	return true;
}
示例#9
0
/* Load the Brain stats */
static bool bufferSBRAINLoad(const char *pBuffer, UDWORD size, void **ppData)
{
	calcDataHash((uint8_t *)pBuffer, size, DATA_SBRAIN);

	if (!loadBrainStats(pBuffer, size)
	 || !allocComponentList(COMP_BRAIN, numBrainStats))
	{
		return false;
	}

	//not interested in this value
	*ppData = NULL;
	return true;
}
示例#10
0
/* Load the Repair stats */
static bool bufferSREPAIRLoad(const char *pBuffer, UDWORD size, void **ppData)
{
	calcDataHash((uint8_t *)pBuffer, size, DATA_SREPAIR);

	if (!loadRepairStats(pBuffer, size)
	 || !allocComponentList(COMP_REPAIRUNIT, numRepairStats))
	{
		return false;
	}

	//not interested in this value
	*ppData = NULL;
	return true;
}
示例#11
0
/* Load the Sensor stats */
static bool bufferSSENSORLoad(const char *pBuffer, UDWORD size, void **ppData)
{
	calcDataHash((uint8_t *)pBuffer, size, DATA_SSENSOR);

	if (!loadSensorStats(pBuffer, size)
	 || !allocComponentList(COMP_SENSOR, numSensorStats))
	{
		return false;
	}

	//not interested in this value
	*ppData = NULL;
	return true;
}
示例#12
0
/* Load the Propulsion stats */
static bool bufferSPROPLoad(const char *pBuffer, UDWORD size, void **ppData)
{
	calcDataHash((uint8_t *)pBuffer, size, DATA_SPROP);

	if (!loadPropulsionStats(pBuffer, size)
	 || !allocComponentList(COMP_PROPULSION, numPropulsionStats))
	{
		return false;
	}

	//not interested in this value
	*ppData = NULL;
	return true;
}
示例#13
0
/* Load the constructor stats */
static bool bufferSCONSTRLoad(const char *pBuffer, UDWORD size, void **ppData)
{
	calcDataHash((uint8_t *)pBuffer, size, DATA_SCONSTR);

	if (!loadConstructStats(pBuffer, size)
	 || !allocComponentList(COMP_CONSTRUCT, numConstructStats))
	{
		return false;
	}

	//not interested in this value
	*ppData = NULL;
	return true;
}
示例#14
0
/* Load the body stats */
static bool bufferSBODYLoad(const char *pBuffer, UDWORD size, void **ppData)
{
	calcDataHash((uint8_t *)pBuffer, size, DATA_SBODY);

	if (!loadBodyStats(pBuffer, size)
	 || !allocComponentList(COMP_BODY, numBodyStats))
	{
		return false;
	}

	// set a dummy value so the release function gets called
	*ppData = (void *)1;
	return true;
}
示例#15
0
/* Load the Propulsion stats */
static bool bufferSPROPLoad(const char *fileName, void **ppData)
{
	WzConfig ini(fileName, WzConfig::ReadOnlyAndRequired);
	calcDataHash(ini, DATA_SPROP);

	if (!loadPropulsionStats(ini) || !allocComponentList(COMP_PROPULSION, numPropulsionStats))
	{
		return false;
	}

	//not interested in this value
	*ppData = (void *)1;
	return true;
}