Skip to content

Commit b5e3f05

Browse files
committed
Update the version to 3.6.35
1 parent b2caeb9 commit b5e3f05

File tree

418 files changed

+7198
-16722
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

418 files changed

+7198
-16722
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ cmake_minimum_required (VERSION 2.8)
3131
# set(CMAKE_CONFIGURATION_TYPES "Debug;Release;Profile" CACHE STRING "" FORCE)
3232
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
3333

34-
set (BEHAVIAC_PACKAGE_VERSION 3.6.34)
34+
set (BEHAVIAC_PACKAGE_VERSION 3.6.35)
3535

3636
#option( BUILD_SHARED_LIBS "set to OFF to build static libraries" ON )
3737
SET(BUILD_SHARED_LIBS ON CACHE BOOL "set to OFF to build static libraries")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://github.com/Tencent/behaviac/blob/master/license.txt)
2-
[![Release Version](https://img.shields.io/badge/release-3.6.34-red.svg)](https://github.com/Tencent/behaviac/releases)
2+
[![Release Version](https://img.shields.io/badge/release-3.6.35-red.svg)](https://github.com/Tencent/behaviac/releases)
33
[![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)
44
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/Tencent/behaviac/pulls)
55

docs/behaviac.chm

-1.45 MB
Binary file not shown.

history.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2017-7-11 3.6.35
2+
Improve the C++ types generation.
3+
Fix a bug of time edition of the Wait node.
4+
Fix a bug of renaming the agent.
5+
Fix a bug of reentering the SelectorProbability node.
6+
Fix other bugs of the editor.
7+
18
2017-5-16 3.6.34
29
Fix a bug for the Parallel node.
310
Fix a bug for exporting the return type of the method.

inc/behaviac/common/_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
#define BEHAVIAC_RELEASE 0
1212
#endif
1313

14-
#define BEHAVIAC_VERSION_STRING "3.6.34"
14+
#define BEHAVIAC_VERSION_STRING "3.6.35"
1515

inc/behaviac/common/member.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1702,6 +1702,10 @@ namespace behaviac {
17021702
return NULL;
17031703
}
17041704

1705+
virtual bool IsMethod() const {
1706+
return true;
1707+
}
1708+
17051709
virtual void load(const char* instance, behaviac::vector<behaviac::string>& paramStrs) {
17061710
BEHAVIAC_UNUSED_VAR(instance);
17071711
BEHAVIAC_UNUSED_VAR(paramStrs);
@@ -1734,7 +1738,10 @@ namespace behaviac {
17341738
}
17351739

17361740
virtual IValue* GetIValueFrom(behaviac::Agent* self, IInstanceMember* firstParam) {
1737-
BEHAVIAC_UNUSED_VAR(firstParam);
1741+
BEHAVIAC_ASSERT(firstParam->IsMethod());
1742+
Agent* agent = Agent::GetParentAgent(self, this->_instance);
1743+
firstParam->run(agent);
1744+
17381745
return GetIValue(self);
17391746
}
17401747

inc/behaviac/common/meta.h

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ namespace behaviac {
137137
static BehaviorLoader* ms_behaviorLoader;
138138

139139
static behaviac::map<behaviac::string, TypeCreator*> _Creators;
140-
//static behaviac::map<behaviac::string, Type*> _typesRegistered;
141140

142141
public:
143142
BEHAVIAC_DECLARE_MEMORY_OPERATORS(AgentMeta);
@@ -165,15 +164,16 @@ namespace behaviac {
165164
const behaviac::map<uint32_t, IProperty*>& GetMemberProperties();
166165
IInstanceMember* GetMethod(uint32_t methodId);
167166

168-
static IProperty* CreateProperty(const behaviac::string& typeName, uint32_t propId, const char* propName, const char* valueStr);
169-
static IProperty* CreateArrayItemProperty(const behaviac::string& typeName, uint32_t parentId, const char* parentName);
170-
static IInstanceMember* CreateInstanceProperty(const behaviac::string& typeName, const char* instance, IInstanceMember* indexMember, uint32_t varId);
171-
static IInstanceMember* CreateInstanceConst(const behaviac::string& typeName, const char* valueStr);
172-
static IProperty* CreateCustomizedProperty(const behaviac::string& typeName, uint32_t propId, const char* propName, const char* valueStr);
173-
static IProperty* CreateCustomizedArrayItemProperty(const behaviac::string& typeName, uint32_t parentId, const char* parentName);
167+
static IProperty* CreateProperty(const char* typeName, uint32_t propId, const char* propName, const char* valueStr);
168+
static IProperty* CreateArrayItemProperty(const char* typeName, uint32_t parentId, const char* parentName);
169+
static IInstanceMember* CreateInstanceProperty(const char* typeName, const char* instance, IInstanceMember* indexMember, uint32_t varId);
170+
static IInstanceMember* CreateInstanceConst(const char* typeName, const char* valueStr);
171+
static IProperty* CreateCustomizedProperty(const char* typeName, uint32_t propId, const char* propName, const char* valueStr);
172+
static IProperty* CreateCustomizedArrayItemProperty(const char* typeName, uint32_t parentId, const char* parentName);
174173

175-
static void CreatorAddElement(const behaviac::string& typeName, TypeCreator* tc);
176-
static void CreatorRemoveElement(const behaviac::string& typeName);
174+
static TypeCreator* GetTypeCreator(const char* typeName);
175+
static void AddTypeCreator(const char* typeName, TypeCreator* tc);
176+
static void RemoveTypeCreator(const char* typeName);
177177

178178
static const char* ParseInstanceNameProperty(const char* fullName, char* instanceName, char* agentType);
179179

@@ -214,8 +214,9 @@ namespace behaviac {
214214
&CreatorCustomizedProperty<RegisteredType>,
215215
&CreatorCustomizedArrayItemProperty<RegisteredType>
216216
);
217-
//_Creators[typeName] = tc;
218-
CreatorAddElement(typeName, tc);
217+
218+
AddTypeCreator(typeName, tc);
219+
219220
char vectorTypeName[1024];
220221
string_sprintf(vectorTypeName, "vector<%s>", typeName);
221222

@@ -226,25 +227,21 @@ namespace behaviac {
226227
CreatorInstanceConst<behaviac::vector<RegisteredType> >,
227228
&CreatorCustomizedProperty<behaviac::vector<RegisteredType> >,
228229
&CreatorCustomizedArrayItemProperty<behaviac::vector<RegisteredType> >);
229-
//_Creators[vectorTypeName] = tcl;
230-
CreatorAddElement(vectorTypeName, tcl);
230+
231+
AddTypeCreator(vectorTypeName, tcl);
231232
}
232233

233234
return true;
234235
}
235236

236237
template<typename T>
237238
static void UnRegister(const char* typeName) {
238-
//_typesRegistered.Remove(typeName);
239-
240-
//_Creators.erase(typeName);
241-
CreatorRemoveElement(typeName);
239+
RemoveTypeCreator(typeName);
242240

243241
char vectorTypeName[1024];
244242
string_sprintf(vectorTypeName, "vector<%s>", typeName);
245243

246-
//_Creators.erase(vectorTypeName);
247-
CreatorRemoveElement(vectorTypeName);
244+
RemoveTypeCreator(vectorTypeName);
248245
}
249246

250247
private:
@@ -278,7 +275,7 @@ namespace behaviac {
278275

279276
behaviac::string typeName = behaviac::GetTypeDescString<Type>();
280277

281-
return AgentMeta::CreateInstanceConst(typeName, value);
278+
return AgentMeta::CreateInstanceConst(typeName.c_str(), value);
282279
}
283280

284281
return ParseProperty(value);

inc/behaviac/common/socket/socketconnect_base.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "behaviac/common/thread/wrapper.h"
2222
#include "behaviac/common/container/string.h"
2323

24+
2425
#include <string>
2526

2627
#define USING_BEHAVIAC_SEQUENTIAL 1
@@ -106,11 +107,11 @@ namespace behaviac {
106107
#endif
107108

108109
struct ModuleInfo {
109-
enum { MAX_PATH_LEN = 128 };
110+
enum { BEHAVIAC_MAX_PATH_LEN = 128 };
110111

111112
unsigned long moduleBase;
112113
unsigned long moduleSize;
113-
char debugInfoFile[MAX_PATH_LEN];
114+
char debugInfoFile[BEHAVIAC_MAX_PATH_LEN];
114115
};
115116

116117
namespace CommandId {

integration/demo_running/behaviac/Base/Member.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,6 +1027,9 @@ public virtual IValue GetIValue(Agent self)
10271027

10281028
public virtual IValue GetIValue(Agent self, IInstanceMember firstParam)
10291029
{
1030+
Agent agent = Utils.GetParentAgent(self, _instance);
1031+
firstParam.Run(agent);
1032+
10301033
return GetIValue(self);
10311034
}
10321035

@@ -3988,6 +3991,9 @@ public object GetValueObject(Agent self)
39883991

39893992
public IValue GetIValue(Agent self, IInstanceMember firstParam)
39903993
{
3994+
//Agent agent = Utils.GetParentAgent(self, _instance);
3995+
//firstParam.Run(agent);
3996+
39913997
return GetIValue(self);
39923998
}
39933999

integration/demo_running/behaviac/Base/Meta.cs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,15 @@ public ICustomizedProperty CreateCustomizedArrayItemProperty(uint id, string nam
336336
}
337337
}
338338

339+
public static string GetTypeName(string typeName)
340+
{
341+
typeName = typeName.Replace("*", "");
342+
return typeName;
343+
}
344+
339345
public static ICustomizedProperty CreateProperty(string typeName, uint propId, string propName, string valueStr)
340346
{
347+
typeName = GetTypeName(typeName);
341348
if (_Creators.ContainsKey(typeName))
342349
{
343350
TypeCreator creator = _Creators[typeName];
@@ -350,6 +357,7 @@ public static ICustomizedProperty CreateProperty(string typeName, uint propId, s
350357

351358
public static ICustomizedProperty CreateArrayItemProperty(string typeName, uint parentId, string parentName)
352359
{
360+
typeName = GetTypeName(typeName);
353361
if (_Creators.ContainsKey(typeName))
354362
{
355363
TypeCreator creator = _Creators[typeName];
@@ -362,6 +370,7 @@ public static ICustomizedProperty CreateArrayItemProperty(string typeName, uint
362370

363371
public static IInstanceMember CreateInstanceProperty(string typeName, string instance, IInstanceMember indexMember, uint varId)
364372
{
373+
typeName = GetTypeName(typeName);
365374
if (_Creators.ContainsKey(typeName))
366375
{
367376
TypeCreator creator = _Creators[typeName];
@@ -374,6 +383,7 @@ public static IInstanceMember CreateInstanceProperty(string typeName, string ins
374383

375384
public static IInstanceMember CreateInstanceConst(string typeName, string valueStr)
376385
{
386+
typeName = GetTypeName(typeName);
377387
if (_Creators.ContainsKey(typeName))
378388
{
379389
TypeCreator creator = _Creators[typeName];
@@ -386,6 +396,7 @@ public static IInstanceMember CreateInstanceConst(string typeName, string valueS
386396

387397
public static ICustomizedProperty CreateCustomizedProperty(string typeName, uint id, string name, string valueStr)
388398
{
399+
typeName = GetTypeName(typeName);
389400
if (_Creators.ContainsKey(typeName))
390401
{
391402
TypeCreator creator = _Creators[typeName];
@@ -398,6 +409,7 @@ public static ICustomizedProperty CreateCustomizedProperty(string typeName, uint
398409

399410
public static ICustomizedProperty CreateCustomizedArrayItemProperty(string typeName, uint id, string name)
400411
{
412+
typeName = GetTypeName(typeName);
401413
if (_Creators.ContainsKey(typeName))
402414
{
403415
TypeCreator creator = _Creators[typeName];
@@ -729,11 +741,14 @@ public static IInstanceMember ParseProperty(string value, List<string> tokens =
729741
uint propId = Utils.MakeVariableId(propName + arrayItem);
730742

731743
// property
732-
IProperty p = meta.GetProperty(propId);
733-
734-
if (p != null)
744+
if (meta != null)
735745
{
736-
return p.CreateInstance(instantceName, indexMember);
746+
IProperty p = meta.GetProperty(propId);
747+
748+
if (p != null)
749+
{
750+
return p.CreateInstance(instantceName, indexMember);
751+
}
737752
}
738753

739754
// local var

0 commit comments

Comments
 (0)