Defining EventTag Parameters in C++

EventTag的参数是一个数组类型,为了完全支持蓝图,需要定义参数的具体类型。数组的数据类型为一个共享指针,所以使用基本的共享指针类型来定义即可,你所需要关注的是参数的问题。

Example definition:
The EventTag parameter is an array type. To fully support Blueprints, the specific type of the parameter needs to be defined. The array's data type is a shared pointer, so it can be defined using the basic shared pointer type. What you need to focus on is the parameter issue.

1. FEventParam

Used to define common property types in UE.
EventName: the name of the event parameter
ParameterType: the type of the event parameter. For details, refer to the EEventParameterType enum definition: Note: The usage of CustomEnum/CustomStruct/Object/Class/SoftObject/SoftClass is special. These are not within the parameter scope of FEventParam, so do not use it to define them. Their usage will be described one by one in this article.
ParameterContainerType: the container type of the parameter. The available options are None, Array, and Set.
Usage example:

2. FEventParamEnum

This is the definition of TYPE_CustomEnum. Note that this enum class must be a standard enum class that can be used by UE Blueprints.
InEventName: the name of the event parameter
InEnumClassNameString: the name string of the enum class.
ParameterContainerType: the container type of the parameter. The available options are None, Array, and Set. Usage example:

3. FEventParamStruct

This is the definition of TYPE_CustomStruct. It is a template class. It is defined as FEventParamStruct<TStruct>(EventName, ParameterContainerType).
TStruct: the struct type you define, as shown below:
EventName: the name of the event parameter
ParameterContainerType: the container type of the parameter. The available options are None, Array, and Set. Usage example:

4. FEventParamClass

This is the parameter definition for the four types TYPE_Class/TYPE_Object/TYPE_SoftObject/TYPE_SoftClass. It is also a template class. It is defined as FEventParamClass<TClass>(EventName, ParamType, ParameterContainerType).
TClass: any class marked with UCLASS.
EventName: the name of the event parameter
ParameterType: the type of the event parameter. Here you only need to use one of the four types: TYPE_Class/TYPE_Object/TYPE_SoftObject/TYPE_SoftClass.
ParameterContainerType: the container type of the parameter. The available options are None, Array, and Set. Usage example:

5. Map Type Parameters (Although passed by reference, parameters of this type should be avoided as much as possible)

1.1. FEventParamMap

Defined as FEventParamMap(EventName, KeyParamType, ValueParamType). This is the Map type for parameter types other than CustomEnum/CustomStruct/Object/Class/SoftObject/SoftClass.

1.2. FEventParamMap_ClassValue

Defined as FEventParamMap_ClassValue<TValueClass>(EventName, KeyParamType, ValueParamType). This is the utility class provided for value types TYPE_Class/TYPE_Object/TYPE_SoftObject/TYPE_SoftClass.

1.3. FEventParamMap_StructValue

Defined as FEventParamMap_StructValue<TValueStruct>(EventName, KeyParamType). This is the utility class provided for value type TYPE_CustomStruct.

1.4. FEventParamMap_EnumValue

Defined as FEventParamMap_EnumValue(EventName, KeyParamType, InEnumClassNameString). This is the utility class provided for value type TYPE_CustomEnum.

2.1. FEventParamMap_ClassKey

The utility class provided for key type TYPE_Class/TYPE_Object/TYPE_SoftObject/TYPE_SoftClass. Defined as FEventParamMap_ClassKey<TKeyClass>(EventName, KeyParamType, ValueParamType)

2.2. FEventParamMap_ClassKey_ClassValue

The utility class provided for both key and value types TYPE_Class/TYPE_Object/TYPE_SoftObject/TYPE_SoftClass. Defined as FEventParamMap_ClassKey_ClassValue<TKeyClass, TValueClass>(EventName, KeyParamType, ValueParamType)

2.3. FEventParamMap_ClassKey_StructValue

The utility class provided for key type TYPE_Class/TYPE_Object/TYPE_SoftObject/TYPE_SoftClass and value type TYPE_CustomStruct. Defined as FEventParamMap_ClassKey_StructValue<TKeyClass, TValueStruct>(EventName, KeyParamType)

2.4 FEventParamMap_ClassKey_EnumValue

The utility class provided for key type TYPE_Class/TYPE_Object/TYPE_SoftObject/TYPE_SoftClass and value type TYPE_CustomEnum. Defined as FEventParamMap_ClassKey_EnumValue<TKeyClass>(EventName, KeyParamType, InValueEnumNameString)

3.1. FEventParamMap_EnumKey

The utility class provided for key type TYPE_CustomEnum. Defined as FEventParamMap_EnumKey(EventName, InKeyEnumNameString, ValueParamType)

3.2. FEventParamMap_EnumKey_ClassValue

The utility class provided for key type TYPE_CustomEnum and value types TYPE_Class/TYPE_Object/TYPE_SoftObject/TYPE_SoftClass. Defined as FEventParamMap_EnumKey_ClassValue<TValueClass>(EventName, InKeyEnumNameString, ValueParamType)

3.3. FEventParamMap_EnumKey_StructValue

The utility class provided for key type TYPE_CustomEnum and value type TYPE_CustomStruct. Defined as FEventParamMap_EnumKey_StructValue<TValueStruct>(EventName, InKeyEnumNameString)

3.4 FEventParamMap_EnumKey_EnumValue

The utility class provided for key type TYPE_CustomEnum and value type TYPE_CustomEnum. Defined as FEventParamMap_EnumKey_EnumValue(EventName, InKeyEnumNameString, InValueEnumNameString)

Comments

Table of Contents