예제 #1
0
CKERROR CreateAddNodalLinkProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = NULL;
	proto = CreateCKBehaviorPrototype("Create Nodal Edge");
	if(!proto) return CKERR_OUTOFMEMORY;
	
	proto->DeclareInput("In");
	proto->DeclareOutput("Out");

	proto->DeclareInParameter("Nodal Path",CKPGUID_GROUP);
	proto->DeclareInParameter("Start Node",CKPGUID_3DENTITY);
	proto->DeclareInParameter("End Node",CKPGUID_3DENTITY);
	proto->DeclareInParameter("Difficult",CKPGUID_FLOAT);


	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetFunction( AddNodalLink );
	
	*pproto = proto;
	return CK_OK;
	
}
예제 #2
0
/*
 *******************************************************************
 * Function: CKERROR CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
 *
 * Description : The prototype creation function will be called the first time 
 *               a behavior must be created to create the CKBehaviorPrototype 
 *               that contains the description of the behavior.
 *
 * Parameters :
 *    behaviorPrototypePtr    w   Pointer to a CKBehaviorPrototype object that 
 *                                describes the behavior's internal structure 
 *                                and relationships with other objects.
 *
 * Returns : CKERROR
 *
 *******************************************************************
 */
CKERROR GBLLDEnableForFac::CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
{
    CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLLDEnableForFac" );
    if ( !behaviorPrototype ) 
    {
        return CKERR_OUTOFMEMORY;
    }
    
    //---     Inputs declaration

    //---     Outputs declaration


    //----	Local Parameters Declaration
    
    //----	Settings Declaration

    behaviorPrototype->SetFunction( GBLLDEnableForFac::BehaviourFunction );
    
    *behaviorPrototypePtr = behaviorPrototype;
    return CK_OK;
}
예제 #3
0
CKERROR CreateDOUserValueModifiedProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("DOUserValueModified");
	if(!proto) return CKERR_OUTOFMEMORY;

	proto->DeclareInput("In");
	proto->DeclareInput("Off");
	proto->DeclareInput("Next Value");



	proto->DeclareOutput("Exit In");
	proto->DeclareOutput("Exit Off");
	proto->DeclareOutput("New Value");
	proto->DeclareOutput("Error");


	
	proto->DeclareInParameter("Connection ID", CKPGUID_INT, "0");
	proto->DeclareInParameter("Object", CKPGUID_BEOBJECT, "test");
	
	proto->DeclareOutParameter("Time", CKPGUID_TIME, "0");
	proto->DeclareOutParameter("Value", CKPGUID_STRING, "No Error");
	proto->DeclareOutParameter("Error", VTE_NETWORK_ERROR, "Ok");

	proto->DeclareSetting("Class", CKPGUID_STRING, "My3DClass");
	proto->DeclareSetting("Parameter Name", CKPGUID_STRING, "test");

	
	
	proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	proto->SetBehaviorFlags((CK_BEHAVIOR_FLAGS)( CKBEHAVIOR_VARIABLEPARAMETEROUTPUTS  ));
	proto->SetFunction(DOUserValueModified);
	proto->SetBehaviorCallbackFct(DOUserValueModifiedCB);

	*pproto = proto;
	return CK_OK;

}
예제 #4
0
/*
 *******************************************************************
 * Function: CKERROR CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
 *
 * Description : The prototype creation function will be called the first time 
 *               a behavior must be created to create the CKBehaviorPrototype 
 *               that contains the description of the behavior.
 *
 * Paramters :
 *    behaviorPrototypePtr    w   Pointer to a CKBehaviorPrototype object that 
 *                                describes the behavior's internal structure 
 *                                and relationships with other objects.
 *
 * Returns : CKERROR
 *
 *******************************************************************
 */
CKERROR CGBLLAESetLoadState::CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
{
    CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLLAESetLoadState" );
    if ( !behaviorPrototype ) 
    {
        return CKERR_OUTOFMEMORY;
    }
    
	//---     Inputs declaration
	behaviorPrototype->DeclareInput( "SetLoadState" );

	behaviorPrototype->DeclareInParameter("LoadState", GUID_EGBLLAELOADSTATE);

	//---     Outputs declaration
	behaviorPrototype->DeclareOutput( "LoadStateSet" );
	behaviorPrototype->DeclareOutput( "Error" );


	behaviorPrototype->DeclareOutParameter("Error", GUID_TGBLERROR);

	//----

	





    //----	Local Parameters Declaration
    
    //----	Settings Declaration

	behaviorPrototype->SetBehaviorCallbackFct( CGBLLAESetLoadState::CallBack, CKCB_BEHAVIORATTACH|CKCB_BEHAVIORDETACH|CKCB_BEHAVIORDELETE|CKCB_BEHAVIOREDITED|CKCB_BEHAVIORSETTINGSEDITED|CKCB_BEHAVIORLOAD|CKCB_BEHAVIORPRESAVE|CKCB_BEHAVIORPOSTSAVE|CKCB_BEHAVIORRESUME|CKCB_BEHAVIORPAUSE|CKCB_BEHAVIORRESET|CKCB_BEHAVIORRESET|CKCB_BEHAVIORDEACTIVATESCRIPT|CKCB_BEHAVIORACTIVATESCRIPT|CKCB_BEHAVIORREADSTATE, NULL );
    behaviorPrototype->SetFunction( CGBLLAESetLoadState::BehaviourFunction );
    
    *behaviorPrototypePtr = behaviorPrototype;
    return CK_OK;
}
/*
*******************************************************************
* Function: CKERROR CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
*
* Description : The prototype creation function will be called the first time 
*               a behavior must be created to create the CKBehaviorPrototype 
*               that contains the description of the behavior.
*
* Parameters :
*    behaviorPrototypePtr    w   Pointer to a CKBehaviorPrototype object that 
*                                describes the behavior's internal structure 
*                                and relationships with other objects.
*
* Returns : CKERROR
*
*******************************************************************
*/
CKERROR CGBLCHPopulateAvailableRecipients::CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
{
    CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype("GBLCHPopulateAvailableRecipients");
    if ( !behaviorPrototype ) 
    {
        return CKERR_OUTOFMEMORY;
    }

    //---     Inputs declaration
    if (eBehInputOn != behaviorPrototype->DeclareInput("On"))
        assert(NULL);

    //---     Outputs declaration
    if (eBehOutputDone != behaviorPrototype->DeclareOutput("Done"))
        assert(NULL);
    if (eBehOutputError != behaviorPrototype->DeclareOutput("Error"))
        assert(NULL);
    

    //---     Output Parameters declaration
    if (eParamOutputError != behaviorPrototype->DeclareOutParameter("ErrorCode", GUID_TGBLERROR))
        assert(NULL);

    //---     Inputs Parameters declaration
    if (eParamInputAvailableRecipientsArray != behaviorPrototype->DeclareInParameter("AvailableRecipientsArray", CKPGUID_DATAARRAY))
        assert(NULL);


    //----	Local Parameters Declaration

    //----	Settings Declaration

    behaviorPrototype->SetFunction( CGBLCHPopulateAvailableRecipients::BehaviourFunction );

    *behaviorPrototypePtr = behaviorPrototype;
    return CK_OK;
}
/*
*******************************************************************
* Function:CreateAddPacketProto()
*
* Description : Behavior prototypes describe the Bb's internal structure.   
*
* Parameters :  CKBehaviorPrototype **pproto :  r,w
*
* Returns :	CKERROR = CK_OK if the building block prototype was correct created.  
*
*******************************************************************
*/
CKERROR CreateSetCIConnectionDetailsProto(CKBehaviorPrototype **pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("SetMOConnectionDetails");
	if(!proto) return CKERR_OUTOFMEMORY;

	proto->DeclareInput("Set Details");
	proto->DeclareOutput("Set Exit");

	proto->DeclareInParameter("network message", CKPGUID_STRING,"GBLInternal");
	proto->DeclareInParameter("network connection id", CKPGUID_INT,"");
   
	if(!GBLDebugBuild)
	{
		proto->SetFlags(CK_BEHAVIORPROTOTYPE_HIDDEN);
	}else
	{
		proto->SetFlags(CK_BEHAVIORPROTOTYPE_NORMAL);
	}

	proto->SetFunction(SetCIConnectionDetails);
	
	*pproto = proto;
	return CK_OK;
}
예제 #7
0
/*
 *******************************************************************
 * Function: CKERROR CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
 *
 * Description : The prototype creation function will be called the first time 
 *               a behavior must be created to create the CKBehaviorPrototype 
 *               that contains the description of the behavior.
 *
 * Parameters :
 *    behaviorPrototypePtr    w   Pointer to a CKBehaviorPrototype object that 
 *                                describes the behavior's internal structure 
 *                                and relationships with other objects.
 *
 * Returns : CKERROR
 *
 *******************************************************************
 */
CKERROR GBLPFCreate::CreatePrototype( CKBehaviorPrototype** behaviorPrototypePtr )
{
    CKBehaviorPrototype *behaviorPrototype = CreateCKBehaviorPrototype( "GBLPFCreate" );
    if ( !behaviorPrototype ) 
    {
        return CKERR_OUTOFMEMORY;
    }
    
//---     Inputs declaration
	behaviorPrototype->DeclareInput( "In" );

//---     Outputs declaration
	behaviorPrototype->DeclareOutput( "OutSuccess" );
	behaviorPrototype->DeclareOutput( "OutError" );

//---     Input Parameters declaration
	behaviorPrototype->DeclareInParameter( "SetType", EGBLUserTypeGUID );
	behaviorPrototype->DeclareInParameter( "SetUsername", CKPGUID_STRING );
	behaviorPrototype->DeclareInParameter( "SetLAEID", CKPGUID_INT );
	behaviorPrototype->DeclareInParameter( "SetTeamName", CKPGUID_STRING );

//---     Output Parameters declaration
	
	behaviorPrototype->DeclareOutParameter( "GetErrorCode", GUID_TGBLERROR );
    behaviorPrototype->DeclareOutParameter( "GetNewProfileID", GUID_PROFILE_ID );

    //----	Local Parameters Declaration
    
    //----	Settings Declaration

	behaviorPrototype->SetBehaviorCallbackFct( GBLPFCreate::CallBack, CKCB_BEHAVIORATTACH|CKCB_BEHAVIORDETACH|CKCB_BEHAVIORDELETE|CKCB_BEHAVIOREDITED|CKCB_BEHAVIORSETTINGSEDITED|CKCB_BEHAVIORLOAD|CKCB_BEHAVIORPRESAVE|CKCB_BEHAVIORPOSTSAVE|CKCB_BEHAVIORRESUME|CKCB_BEHAVIORPAUSE|CKCB_BEHAVIORRESET|CKCB_BEHAVIORRESET|CKCB_BEHAVIORDEACTIVATESCRIPT|CKCB_BEHAVIORACTIVATESCRIPT|CKCB_BEHAVIORREADSTATE, NULL );
    behaviorPrototype->SetFunction( GBLPFCreate::BehaviourFunction );
    
    *behaviorPrototypePtr = behaviorPrototype;
    return CK_OK;
}
예제 #8
0
/*
 *******************************************************************
 * Function: CKERROR CreateBehaviourPrototype( CKBehaviorPrototype** behaviorPrototypePtr )
 *
 * Description : The prototype creation function will be called the first time 
 *               a behavior must be created to create the CKBehaviorPrototype 
 *               that contains the description of the behavior.
 *
 * Paramters :
 *    behaviorPrototypePtr    w   Pointer to a CKBehaviorPrototype object that 
 *                                describes the behavior's internal structure 
 *                                and relationships with other objects.
 *
 * Returns : CKERROR
 *
 *******************************************************************
 */
CKERROR CGBLBuildCommand::CreateBehaviourPrototype(CKBehaviorPrototype** pproto)
{
	CKBehaviorPrototype *proto = CreateCKBehaviorPrototype("GBLFCBuildCommand");
	if (!proto) 
    {
		return CKERR_OUTOFMEMORY;
	}

//---     Inputs declaration

	/**
	* Starts building the command. Find required WaitForCommand BB, determine its
	* target (EGBLFCTarget) and attributes.
	*/
	proto->DeclareInput("BuildCommand");

	/**
	* This input is activated if the Build Command BB operation is to be cancelled.
	* For example the Facilitator pressed 'Cancel' button stating that he doesn't
	* want to invoke the command anymore. The allocated data has to be released and
	* 'Cancelled' output activated.
	*/
	proto->DeclareInput("CancelOperation");

	/**
	* The next parameter value has been passed in to the Build Command BB. For
	* example the Facilitator specified a value for prompted parameter and pressed
	* 'OK' button.
	*/
	proto->DeclareInput("ReadNextParameterValue");

//---     Outputs declaration

	/**
	* This output indicates that the build command has been cancelled. For example
	* the Facilitator pressed 'Cancel' button stating that he doesn't want to invoke
	* the command anymore. The allocated data had been released.
	*/
	proto->DeclareOutput("Cancelled");

	/**
	* Indicate that a list of targets for the command is needed to be specified as an
	* array of Virtools user ID's and fed into SetDests parameter input of this
	* building block with ReadNextParameterValue input activated. The GBLTarget (that
	* specifies if the recipient is global, a team or a player) is specified as
	* GetGBLTarget parameter output.
	*/
	proto->DeclareOutput("ListRecipients");

	/**
	* Additional parameter input is required for chosen command. For example a dialog
	* prompting for facilitator input could be displayed for the type and name
	* specified in parameter outputs.
	*/
	proto->DeclareOutput("GetNextParameterValue");

	/**
	* If the value specified (by facilitator) is invalid (for example string instead
	* of integer), the input parameter  has to be obtained again (possibly with
	* additional warning).
	*/
	proto->DeclareOutput("InvalidValue");

	/**
	* States that the message target was a global element and it had been delivered
	* to local object (For it to have a global effect the object needs to be a
	* virtools distributed object or an alternative means of network synchronization
	* implemented by the designer).
	*/
	proto->DeclareOutput("HandleUntargetedCommand");

	/**
	* States that the message target is a network element and  is specified as an
	* array in parameter output. The command itself is encoded to a string and also
	* available as parameter output.
	*/
	proto->DeclareOutput("HandleTargetedCommand");

	/**
	* States that and error occured. The build operation is cancelled
	*/
	proto->DeclareOutput("Error");

//---     Input Parameters declaration

	/**
	* Unique identifier of WaitForCommand building block.
	*/
	proto->DeclareInParameter("CommandID", CKPGUID_INT);

	/**
	* Parameter (argument) value returned as a string. For example from the parameter
	* input dialog.
	*/
	proto->DeclareInParameter("ParameterString", CKPGUID_STRING);

	/**
	* Set an array of target users IDs for SendNetworkMessage building block.
	*/
	proto->DeclareInParameter("Dests", CKPGUID_DATAARRAY);
	


//---     Output Parameters declaration

	/**
	* Additional parameter input is required for chosen command with a specified type
	* given as a string.
	*/
	proto->DeclareOutParameter("ArgumentType", CKPGUID_STRING);

	/**
	* Additional parameter input is required for chosen command with a specified name
	* given as a string.
	*/
	proto->DeclareOutParameter("ArgumentName", CKPGUID_STRING);

	/**
	* Get an array of target users IDs for SendNetworkMessage building block.
	*/
	proto->DeclareOutParameter("Dests", CKPGUID_DATAARRAY);

	/**
	* Returns a string containing encoded command
	*/
	proto->DeclareOutParameter("CommandString", CKPGUID_STRING);


	/**
	* Type of recipient specified by the command (a team, a player or global)
	*/
	proto->DeclareOutParameter("Target", GUID_EGBLTARGET);


	/**
	* Output parameter that returns the designer specified list of acceptable
	* values for the argument that GBLBuildCommand BB requested for (by activating 
	* GetNextArgument b-out).
	*/
	proto->DeclareOutParameter("DesignerSpecifiedList", CKPGUID_DATAARRAY);


	/**
	* Parameter output that returns the description for an error that occurred.
	*/
	proto->DeclareOutParameter("Error", GUID_TGBLERROR);


	/**
	* Current state of this BB
	*/
	gblBuildCommandStateLocalPos = proto->DeclareLocalParameter("gblBuildCommandState", CKPGUID_INT, "0");

	/**
	* Position of iterator for target's outputs
	*/
	currentParameterPositionLocalPos = proto->DeclareLocalParameter("currentParameterPosition", CKPGUID_INT, "0");

	/**
	* Target BB
	*/
	targetBBLocalPos = proto->DeclareLocalParameter("targetBB", CKPGUID_BEHAVIOR, "0");

	/**
	* Command string
	*/
	commandStringLocalPos = proto->DeclareLocalParameter("commandString", CKPGUID_STRING);



//----	Local Parameters Declaration

//----	Settings Declaration
	proto->SetBehaviorFlags((CK_BEHAVIOR_FLAGS)(CKBEHAVIOR_MESSAGESENDER));
	proto->SetBehaviorCallbackFct(CallbackFunction, NULL, NULL);
	proto->SetFunction(BehaviourFunction);

	*pproto = proto;
	return CK_OK;
}