示例#1
0
static installation_t* CreateInstallation (const char* name, const vec2_t pos)
{
	const installationTemplate_t* installationTemplate = INS_GetInstallationTemplateByType(INSTALLATION_UFOYARD);
	installation_t* installation = INS_Build(installationTemplate, pos, name);

	/* fake the build time */
	installation->buildStart = ccs.date.day - installation->installationTemplate->buildTime;
	INS_UpdateInstallationData();

	return installation;
}
示例#2
0
static installation_t* CreateInstallation (const char *name, const vec2_t pos)
{
	const installationTemplate_t *installationTemplate = INS_GetInstallationTemplateFromInstallationID("ufoyard");
	installation_t *installation = INS_GetFirstUnfoundedInstallation();

	CU_ASSERT_PTR_NOT_NULL_FATAL(installationTemplate);

	CU_ASSERT_PTR_NOT_NULL_FATAL(installation);

	CU_ASSERT_FALSE(installation->founded);

	INS_SetUpInstallation(installation, installationTemplate, pos, name);
	CU_ASSERT_EQUAL(installation->installationStatus, INSTALLATION_UNDER_CONSTRUCTION);

	/* fake the build time */
	installation->buildStart = ccs.date.day - installation->installationTemplate->buildTime;
	INS_UpdateInstallationData();
	CU_ASSERT_EQUAL(installation->installationStatus, INSTALLATION_WORKING);

	return installation;
}