Esempio n. 1
0
void CAIInterfaceLibraryInfo::SetShortName(const std::string& shortName) {
	SetInfo(AI_INTERFACE_PROPERTY_SHORT_NAME, shortName);
}
Esempio n. 2
0
void CAIInterfaceLibraryInfo::SetVersion(const std::string& version) {
	SetInfo(AI_INTERFACE_PROPERTY_VERSION, version);
}
Esempio n. 3
0
void CAIInterfaceLibraryInfo::SetDataDirCommon(const std::string& dataDirCommon) {
	SetInfo(AI_INTERFACE_PROPERTY_DATA_DIR_COMMON, dataDirCommon);
}
Esempio n. 4
0
void CAIInterfaceLibraryInfo::SetDataDir(const std::string& dataDir) {
	SetInfo(AI_INTERFACE_PROPERTY_DATA_DIR, dataDir);
}
Esempio n. 5
0
void Skill::Init(void)
{
	SetInfo(0,0,0);
	SetUse(FALSE);
}
/************************************************************************************************
 * CRMGroupInstance::CRMGroupInstance
 *	constructur
 *
 * inputs:
 *  settlementID:  ID of the settlement being created
 *
 * return:
 *	none
 *
 ************************************************************************************************/
CRMGroupInstance::CRMGroupInstance ( CGPGroup *instGroup, CRMInstanceFile& instFile )
    :  CRMInstance ( instGroup, instFile )
{
    // Grab the padding and confine radius
    mPaddingSize   = atof ( instGroup->FindPairValue ( "padding", va("%i", TheRandomMissionManager->GetMission()->GetDefaultPadding() ) ) );
    mConfineRadius = atof ( instGroup->FindPairValue ( "confine", "0" ) );

    const char * automapSymName = instGroup->FindPairValue ( "automap_symbol", "none" );
    if (0 == Q_stricmp(automapSymName, "none"))	   	mAutomapSymbol = AUTOMAP_NONE ;
    else if (0 == Q_stricmp(automapSymName, "building"))  	mAutomapSymbol = AUTOMAP_BLD  ;
    else if (0 == Q_stricmp(automapSymName, "objective")) 	mAutomapSymbol = AUTOMAP_OBJ  ;
    else if (0 == Q_stricmp(automapSymName, "start"))	   	mAutomapSymbol = AUTOMAP_START;
    else if (0 == Q_stricmp(automapSymName, "end"))	   	mAutomapSymbol = AUTOMAP_END  ;
    else if (0 == Q_stricmp(automapSymName, "enemy"))	   	mAutomapSymbol = AUTOMAP_ENEMY;
    else if (0 == Q_stricmp(automapSymName, "friend"))	   	mAutomapSymbol = AUTOMAP_FRIEND;
    else mAutomapSymbol	= atoi( automapSymName );

    // optional instance objective strings
    SetMessage(instGroup->FindPairValue("objective_message",""));
    SetDescription(instGroup->FindPairValue("objective_description",""));
    SetInfo(instGroup->FindPairValue("objective_info",""));

    // Iterate through the sub groups to determine the instances which make up the group
    instGroup = instGroup->GetSubGroups ( );

    while ( instGroup )
    {
        CRMInstance* instance;
        const char*  name;
        int			 mincount;
        int			 maxcount;
        int			 count;
        float		 minrange;
        float		 maxrange;

        // Make sure only instances are specified as sub groups
        assert ( 0 == stricmp ( instGroup->GetName ( ), "instance" ) );

        // Grab the name
        name     = instGroup->FindPairValue ( "name", "" );

        // Grab the range information
        minrange = atof(instGroup->FindPairValue ( "minrange", "0" ) );
        maxrange = atof(instGroup->FindPairValue ( "maxrange", "0" ) );

        // Grab the count information and randomly generate a count value
        mincount = atoi(instGroup->FindPairValue ( "mincount", "1" ) );
        maxcount = atoi(instGroup->FindPairValue ( "maxcount", "1" ) );
        count	 = mincount;

        if ( maxcount > mincount )
        {
            count += (TheRandomMissionManager->GetLandScape()->irand(0, maxcount-mincount));
        }

        // For each count create and add the instance
        for ( ; count ; count -- )
        {
            // Create the instance
            instance = instFile.CreateInstance ( name );

            // Skip this instance if it couldnt be created for some reason.  The CreateInstance
            // method will report an error so no need to do so here.
            if ( NULL == instance )
            {
                continue;
            }

            // Set the min and max range for the instance
            instance->SetFilter(mFilter);
            instance->SetTeamFilter(mTeamFilter);

            // Add the instance to the list
            mInstances.push_back ( instance );
        }

        // Next sub group
        instGroup = instGroup->GetNext ( );
    }
}
Esempio n. 7
0
int
main(
    int argc,
    char** ppszArgv
    )
{
    DWORD dwError = 0;
    DWORD dwIndex = 0;

    dwError = SrvSvcInitMemory();
    BAIL_ON_SRVSVC_ERROR(dwError);

    if (argc < 2)
    {
        Usage();
        return 1;
    }

    for (dwIndex = 1; dwIndex < argc; dwIndex++)
    {
        if (!strcasecmp(ppszArgv[dwIndex], "--server"))
        {
            dwError = LwMbsToWc16s(ppszArgv[++dwIndex], &gState.pwszServerName);
            BAIL_ON_SRVSVC_ERROR(dwError);
        }
        else if (!strcasecmp(ppszArgv[dwIndex], "--help"))
        {
            Help();
            return 1;
        }
        else if (!strcasecmp(ppszArgv[dwIndex], "--usage"))
        {
            Help();
            return 1;
        }
        else if (!strcasecmp(ppszArgv[dwIndex], "enum"))
        {
            dwError = Enum(argc - dwIndex, ppszArgv + dwIndex);
            BAIL_ON_SRVSVC_ERROR(dwError);
            break;
        }
        else if (!strcasecmp(ppszArgv[dwIndex], "enum-info"))
        {
            dwError = EnumInfo(argc - dwIndex, ppszArgv + dwIndex);
            BAIL_ON_SRVSVC_ERROR(dwError);
            break;
        }
        else if (!strcasecmp(ppszArgv[dwIndex], "get-info"))
        {
            dwError = GetInfo(argc - dwIndex, ppszArgv + dwIndex);
            BAIL_ON_SRVSVC_ERROR(dwError);
            break;
        }
        else if (!strcasecmp(ppszArgv[dwIndex], "set-info"))
        {
            dwError = SetInfo(argc - dwIndex, ppszArgv + dwIndex);
            BAIL_ON_SRVSVC_ERROR(dwError);
            break;
        }
        else if (!strcasecmp(ppszArgv[dwIndex], "add"))
        {
            dwError = Add(argc - dwIndex, ppszArgv + dwIndex);
            BAIL_ON_SRVSVC_ERROR(dwError);
            break;
        }
        else if (!strcasecmp(ppszArgv[dwIndex], "del"))
        {
            dwError = Del(argc - dwIndex, ppszArgv + dwIndex);
            BAIL_ON_SRVSVC_ERROR(dwError);
            break;
        }
        else
        {
            Usage();
            return 1;
        }
    }

error:

    if (dwError)
    {
        fprintf(stderr, "%s\n", LwWin32ExtErrorToName(dwError));
        return 1;
    }
    else
    {
        return 0;
    }
}