Skip to content

Commit

Permalink
Update the version to 3.6.38
Browse files Browse the repository at this point in the history
  • Loading branch information
cainhuang committed Aug 17, 2017
1 parent 8f314f7 commit ec9e0c9
Show file tree
Hide file tree
Showing 27 changed files with 218 additions and 178 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cmake_minimum_required (VERSION 2.8)
# set(CMAKE_CONFIGURATION_TYPES "Debug;Release;Profile" CACHE STRING "" FORCE)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)

set (BEHAVIAC_PACKAGE_VERSION 3.6.37)
set (BEHAVIAC_PACKAGE_VERSION 3.6.38)

#option( BUILD_SHARED_LIBS "set to OFF to build static libraries" ON )
SET(BUILD_SHARED_LIBS ON CACHE BOOL "set to OFF to build static libraries")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://github.com/Tencent/behaviac/blob/master/license.txt)
[![Release Version](https://img.shields.io/badge/release-3.6.37-red.svg)](https://github.com/Tencent/behaviac/releases)
[![Release Version](https://img.shields.io/badge/release-3.6.38-red.svg)](https://github.com/Tencent/behaviac/releases)
[![Updates](https://img.shields.io/badge/Platform-%20iOS%20%7C%20OS%20X%20%7C%20Android%20%7C%20Windows%20%7C%20Linux%20-brightgreen.svg)](https://github.com/Tencent/behaviac/blob/master/history.txt)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/behaviac/pulls)

Expand Down
3 changes: 3 additions & 0 deletions history.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2017-08-17 3.6.38
Improve the GC for the C#.

2017-08-08 3.6.37
Support generating the codes for initializing the member array.

Expand Down
2 changes: 1 addition & 1 deletion inc/behaviac/common/_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
#define BEHAVIAC_RELEASE 0
#endif

#define BEHAVIAC_VERSION_STRING "3.6.37"
#define BEHAVIAC_VERSION_STRING "3.6.38"

5 changes: 3 additions & 2 deletions integration/demo_running/behaviac/Agent/Agent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,6 @@ public void LogVariables(bool bForce)
}
}
}

#endif
}

Expand All @@ -1375,9 +1374,11 @@ public void LogRunningNodes()
if (Config.IsLoggingOrSocketing && this.m_currentBT != null)
{
List<BehaviorTask> runningNodes = this.m_currentBT.GetRunningNodes(false);
var e = runningNodes.GetEnumerator();

foreach (BehaviorTask behaviorTask in runningNodes)
while (e.MoveNext())
{
BehaviorTask behaviorTask = e.Current;
string btStr = BehaviorTask.GetTickInfo(this, behaviorTask, "enter");

//empty btStr is for internal BehaviorTreeTask
Expand Down
68 changes: 33 additions & 35 deletions integration/demo_running/behaviac/Base/Operation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Tencent is pleased to support the open source community by making behaviac available.
//
// Copyright (C) 2015-2017 THL A29 Limited, a Tencent company. All rights reserved.
Expand Down Expand Up @@ -1818,37 +1818,41 @@ public static EOperatorType ParseOperatorType(string operatorType)

public static bool Compare<T>(T left, T right, EOperatorType comparisonType)
{
bool bLeftNull = (left == null);
bool bRightNull = (right == null);

if (bLeftNull && bRightNull) // both are null
{
if (comparisonType == EOperatorType.E_EQUAL)
{
return true;
}
else if (comparisonType == EOperatorType.E_NOTEQUAL)
{
return false;
}
else
{
Debug.Check(false);
}
}
else if (bLeftNull || bRightNull) // one is null and ther other one is not null
Type type = typeof(T);
if (!type.IsValueType)
{
if (comparisonType == EOperatorType.E_EQUAL)
{
return false;
}
else if (comparisonType == EOperatorType.E_NOTEQUAL)
bool bLeftNull = (left == null);
bool bRightNull = (right == null);

if (bLeftNull && bRightNull) // both are null
{
return true;
if (comparisonType == EOperatorType.E_EQUAL)
{
return true;
}
else if (comparisonType == EOperatorType.E_NOTEQUAL)
{
return false;
}
else
{
Debug.Check(false);
}
}
else
else if (bLeftNull || bRightNull) // one is null and the other is not null
{
Debug.Check(false);
if (comparisonType == EOperatorType.E_EQUAL)
{
return false;
}
else if (comparisonType == EOperatorType.E_NOTEQUAL)
{
return true;
}
else
{
Debug.Check(false);
}
}
}

Expand Down Expand Up @@ -1878,15 +1882,9 @@ public static bool Compare<T>(T left, T right, EOperatorType comparisonType)
}
}

Type type = typeof(T);

if (!type.IsValueType)
{
// reference type
object l = (object)left;
object r = (object)right;

bool bEqual = Object.ReferenceEquals(l, r);
bool bEqual = Object.ReferenceEquals(left, right);

if (bEqual)
{
Expand Down
12 changes: 9 additions & 3 deletions integration/demo_running/behaviac/BehaviorTree/BehaviorTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1494,9 +1494,12 @@ public void InstantiatePars(Dictionary<uint, IInstantiatedVariable> vars)
{
if (this.m_localProps != null)
{
foreach (KeyValuePair<uint, ICustomizedProperty> pair in this.m_localProps)
var e = this.m_localProps.Keys.GetEnumerator();

while (e.MoveNext())
{
vars[pair.Key] = pair.Value.Instantiate();
uint varId = e.Current;
vars[varId] = this.m_localProps[varId].Instantiate();
}
}
}
Expand All @@ -1505,8 +1508,11 @@ public void UnInstantiatePars(Dictionary<uint, IInstantiatedVariable> vars)
{
if (this.m_localProps != null)
{
foreach (uint varId in this.m_localProps.Keys)
var e = this.m_localProps.Keys.GetEnumerator();

while (e.MoveNext())
{
uint varId = e.Current;
vars.Remove(varId);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1372,9 +1372,12 @@ internal void AddVariables(Dictionary<uint, IInstantiatedVariable> vars)
{
if (vars != null)
{
foreach (KeyValuePair<uint, IInstantiatedVariable> pair in vars)
var e = vars.Keys.GetEnumerator();

while (e.MoveNext())
{
this.LocalVars[pair.Key] = pair.Value;
uint varId = e.Current;
this.LocalVars[varId] = vars[varId];
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion integration/demo_running/behaviac/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.37
3.6.38
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,6 @@ public void LogVariables(bool bForce)
}
}
}

#endif
}

Expand All @@ -1375,9 +1374,11 @@ public void LogRunningNodes()
if (Config.IsLoggingOrSocketing && this.m_currentBT != null)
{
List<BehaviorTask> runningNodes = this.m_currentBT.GetRunningNodes(false);
var e = runningNodes.GetEnumerator();

foreach (BehaviorTask behaviorTask in runningNodes)
while (e.MoveNext())
{
BehaviorTask behaviorTask = e.Current;
string btStr = BehaviorTask.GetTickInfo(this, behaviorTask, "enter");

//empty btStr is for internal BehaviorTreeTask
Expand Down
68 changes: 33 additions & 35 deletions integration/unity/Assets/Scripts/behaviac/runtime/Base/Operation.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Tencent is pleased to support the open source community by making behaviac available.
//
// Copyright (C) 2015-2017 THL A29 Limited, a Tencent company. All rights reserved.
Expand Down Expand Up @@ -1818,37 +1818,41 @@ public static EOperatorType ParseOperatorType(string operatorType)

public static bool Compare<T>(T left, T right, EOperatorType comparisonType)
{
bool bLeftNull = (left == null);
bool bRightNull = (right == null);

if (bLeftNull && bRightNull) // both are null
{
if (comparisonType == EOperatorType.E_EQUAL)
{
return true;
}
else if (comparisonType == EOperatorType.E_NOTEQUAL)
{
return false;
}
else
{
Debug.Check(false);
}
}
else if (bLeftNull || bRightNull) // one is null and ther other one is not null
Type type = typeof(T);
if (!type.IsValueType)
{
if (comparisonType == EOperatorType.E_EQUAL)
{
return false;
}
else if (comparisonType == EOperatorType.E_NOTEQUAL)
bool bLeftNull = (left == null);
bool bRightNull = (right == null);

if (bLeftNull && bRightNull) // both are null
{
return true;
if (comparisonType == EOperatorType.E_EQUAL)
{
return true;
}
else if (comparisonType == EOperatorType.E_NOTEQUAL)
{
return false;
}
else
{
Debug.Check(false);
}
}
else
else if (bLeftNull || bRightNull) // one is null and the other is not null
{
Debug.Check(false);
if (comparisonType == EOperatorType.E_EQUAL)
{
return false;
}
else if (comparisonType == EOperatorType.E_NOTEQUAL)
{
return true;
}
else
{
Debug.Check(false);
}
}
}

Expand Down Expand Up @@ -1878,15 +1882,9 @@ public static bool Compare<T>(T left, T right, EOperatorType comparisonType)
}
}

Type type = typeof(T);

if (!type.IsValueType)
{
// reference type
object l = (object)left;
object r = (object)right;

bool bEqual = Object.ReferenceEquals(l, r);
bool bEqual = Object.ReferenceEquals(left, right);

if (bEqual)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1494,9 +1494,12 @@ public void InstantiatePars(Dictionary<uint, IInstantiatedVariable> vars)
{
if (this.m_localProps != null)
{
foreach (KeyValuePair<uint, ICustomizedProperty> pair in this.m_localProps)
var e = this.m_localProps.Keys.GetEnumerator();

while (e.MoveNext())
{
vars[pair.Key] = pair.Value.Instantiate();
uint varId = e.Current;
vars[varId] = this.m_localProps[varId].Instantiate();
}
}
}
Expand All @@ -1505,8 +1508,11 @@ public void UnInstantiatePars(Dictionary<uint, IInstantiatedVariable> vars)
{
if (this.m_localProps != null)
{
foreach (uint varId in this.m_localProps.Keys)
var e = this.m_localProps.Keys.GetEnumerator();

while (e.MoveNext())
{
uint varId = e.Current;
vars.Remove(varId);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1372,9 +1372,12 @@ internal void AddVariables(Dictionary<uint, IInstantiatedVariable> vars)
{
if (vars != null)
{
foreach (KeyValuePair<uint, IInstantiatedVariable> pair in vars)
var e = vars.Keys.GetEnumerator();

while (e.MoveNext())
{
this.LocalVars[pair.Key] = pair.Value;
uint varId = e.Current;
this.LocalVars[varId] = vars[varId];
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.37
3.6.38
4 changes: 2 additions & 2 deletions tools/designer/BehaviacDesigner/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.6.37")]
[assembly: AssemblyFileVersion("3.6.37")]
[assembly: AssemblyVersion("3.6.38")]
[assembly: AssemblyFileVersion("3.6.38")]
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ public static string GetGeneratedDefaultValue(Type type, string typename, string
}
else if (type == typeof(float))
{
if (value == "0")
{
value = "0.0";
}

if (!string.IsNullOrEmpty(value) && !value.ToLowerInvariant().EndsWith("f"))
{
value += "f";
Expand Down
5 changes: 3 additions & 2 deletions tutorials/CsTutorials/behaviac/runtime/Agent/Agent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,6 @@ public void LogVariables(bool bForce)
}
}
}

#endif
}

Expand All @@ -1375,9 +1374,11 @@ public void LogRunningNodes()
if (Config.IsLoggingOrSocketing && this.m_currentBT != null)
{
List<BehaviorTask> runningNodes = this.m_currentBT.GetRunningNodes(false);
var e = runningNodes.GetEnumerator();

foreach (BehaviorTask behaviorTask in runningNodes)
while (e.MoveNext())
{
BehaviorTask behaviorTask = e.Current;
string btStr = BehaviorTask.GetTickInfo(this, behaviorTask, "enter");

//empty btStr is for internal BehaviorTreeTask
Expand Down
Loading

0 comments on commit ec9e0c9

Please sign in to comment.