Skip to content

Commit

Permalink
3.6.34
Browse files Browse the repository at this point in the history
  • Loading branch information
cainhuang committed May 16, 2017
1 parent 72c6510 commit b2caeb9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
Binary file modified docs/behaviac.chm
Binary file not shown.
4 changes: 3 additions & 1 deletion history.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
2017-5-15 3.6.34
2017-5-16 3.6.34
Fix a bug for the Parallel node.
Fix a bug for exporting the return type of the method.
Fix a bug for exporting the local vars.

2017-5-4 3.6.33
Remove the inheritance for the agent type of the referenced behaviors.
Expand Down
8 changes: 8 additions & 0 deletions tools/designer/BehaviacDesignerBase/Data/CsExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ public static string GetGeneratedNativeType(string typeName)
typeName = typeName.Replace("vector<", "List<");
}

if (Plugin.TypeRenames.Count > 0)
{
foreach (KeyValuePair<string, string> typePair in Plugin.TypeRenames)
{
typeName = typeName.Replace(typePair.Key, typePair.Value);
}
}

return typeName;
}

Expand Down
17 changes: 11 additions & 6 deletions tools/designer/Plugins/PluginBehaviac/Exporters/ExporterCpp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,11 @@ private void PreExportMeta(StringWriter file)
}

string methodReturnType = DataCppExporter.GetGeneratedNativeType(method.NativeReturnType);
if (Plugin.IsRefType(method.ReturnType) && !methodReturnType.EndsWith("*"))
{
methodReturnType += "*";
}

string baseClass = (methodReturnType == "void") ? "CAgentMethodVoidBase" : string.Format("CAgentMethodBase<{0}>", methodReturnType);

// class
Expand Down Expand Up @@ -1618,10 +1623,10 @@ private void ExportDelegateMethod(StringWriter file)

if (prop.IsArrayElement)
{
if (prop.IsProperty)
if (prop.IsPar)
{
str_setter = string.Format("\n\tinline void Set_{0}(Agent* self, {1} value, int index) {{ self->SetVariable(\"{2}\",{3}u,value); }};", propName, propType, propBasicName, CRC32.CalcCRC(propBasicName));
str_getter = string.Format("\n\tinline const void* Get_{1}(Agent* self, int index ){{ return &self->GetVariable<{0}>({2}u); }};", propType, propName, CRC32.CalcCRC(propBasicName));
//str_setter = string.Format("\n\tinline void Set_{0}(Agent* self, {1} value, int index) {{ self->SetVariable(\"{2}\",{3}u,value); }};", propName, propType, propBasicName, CRC32.CalcCRC(propBasicName));
//str_getter = string.Format("\n\tinline const void* Get_{1}(Agent* self, int index ){{ return &self->GetVariable<{0}>({2}u); }};", propType, propName, CRC32.CalcCRC(propBasicName));
}
else
{
Expand All @@ -1639,10 +1644,10 @@ private void ExportDelegateMethod(StringWriter file)
}
else
{
if (prop.IsProperty)
if (prop.IsPar)
{
str_setter = string.Format("\n\tinline void Set_{0}(Agent* self, {1} value) {{ self->SetVariable(\"{2}\",{3}u,value); }};", propName, propType, prop.BasicName, CRC32.CalcCRC(propBasicName));
str_getter = string.Format("\n\tinline const void* Get_{1}(Agent* self){{ return &self->GetVariable<{0}>({2}u); }};", propType, propName, CRC32.CalcCRC(propBasicName));
//str_setter = string.Format("\n\tinline void Set_{0}(Agent* self, {1} value) {{ self->SetVariable(\"{2}\",{3}u,value); }};", propName, propType, prop.BasicName, CRC32.CalcCRC(propBasicName));
//str_getter = string.Format("\n\tinline const void* Get_{1}(Agent* self){{ return &self->GetVariable<{0}>({2}u); }};", propType, propName, CRC32.CalcCRC(propBasicName));
}
else
{
Expand Down

0 comments on commit b2caeb9

Please sign in to comment.