This commit is contained in:
aozhiwei 2023-04-03 15:43:21 +08:00
parent 073893df3f
commit a5bcfe9368
14 changed files with 753 additions and 0 deletions

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: android_attack.xml-->
<behavior name="android_attack" agenttype="AndroidAgent" version="5">
<pars>
<par name="_$local_task_param_$_0" type="int" value="0" />
<par name="_$local_task_param_$_1" type="int" value="0" />
</pars>
<node class="Task" id="0">
<property Prototype="Self.BaseAgent::OnAttacked(0,0)" />
<property IsHTN="false" />
<node class="Action" id="1">
<property Method="Self.BaseAgent::CoAttackTarget(int Self.AndroidAgent::_$local_task_param_$_0)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
</behavior>

View File

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: android_pvp.xml-->
<behavior name="android_pvp" agenttype="AndroidAgent" version="5">
<node class="IfElse" id="17">
<node class="Condition" id="18">
<property Operator="Equal" />
<property Opl="Self.BaseAgent::IsGameOver()" />
<property Opr="const bool true" />
</node>
<node class="False" id="7" />
<node class="Selector" id="0">
<node class="IfElse" id="4">
<node class="Condition" id="1">
<property Operator="Equal" />
<property Opl="Self.AndroidAgent::GetState()" />
<property Opr="const State_e kPreBattle" />
</node>
<node class="SelectorProbability" id="6">
<node class="DecoratorWeight" id="8">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 30" />
<attachment class="Event" id="16" flag="event">
<property ReferenceFilename="android_attack" />
<property Task="Self.BaseAgent::OnAttacked(0,0)" />
<property TriggeredOnce="false" />
<property TriggerMode="Return" />
</attachment>
<node class="Action" id="9">
<property Method="Self.AndroidAgent::DoIdle(2000,4000)" />
<property ResultOption="BT_INVALID" />
</node>
</node>
<node class="DecoratorWeight" id="10">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 50" />
<attachment class="Event" id="25" flag="event">
<property ReferenceFilename="android_attack" />
<property Task="Self.BaseAgent::OnAttacked(0,0)" />
<property TriggeredOnce="false" />
<property TriggerMode="Return" />
</attachment>
<node class="Action" id="11">
<property Method="Self.AndroidAgent::DoRandomWalk()" />
<property ResultOption="BT_INVALID" />
</node>
</node>
<node class="DecoratorWeight" id="12">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 20" />
<attachment class="Event" id="26" flag="event">
<property ReferenceFilename="android_attack" />
<property Task="Self.BaseAgent::OnAttacked(0,0)" />
<property TriggeredOnce="false" />
<property TriggerMode="Return" />
</attachment>
<node class="Action" id="13">
<property Method="Self.AndroidAgent::DoRandomShot()" />
<property ResultOption="BT_INVALID" />
</node>
</node>
<node class="DecoratorWeight" id="14">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 0" />
<node class="Action" id="15">
<property Method="Self.AndroidAgent::DoAttack()" />
<property ResultOption="BT_INVALID" />
</node>
</node>
<node class="DecoratorWeight" id="20">
<property DecorateWhenChildEnds="false" />
<property Weight="const int 0" />
<node class="IfElse" id="21">
<node class="Condition" id="22">
<property Operator="Equal" />
<property Opl="Self.BaseAgent::HasTarget(200)" />
<property Opr="const bool true" />
</node>
<node class="Action" id="23">
<property Method="Self.AndroidAgent::DoPursuit()" />
<property ResultOption="BT_INVALID" />
</node>
<node class="False" id="24" />
</node>
</node>
</node>
<node class="True" id="19" />
</node>
<node class="Condition" id="2">
<property Operator="Equal" />
<property Opl="Self.AndroidAgent::GetState()" />
<property Opr="const State_e kFly" />
</node>
<node class="Condition" id="3">
<property Operator="Equal" />
<property Opl="Self.AndroidAgent::GetState()" />
<property Opr="const State_e kJump" />
</node>
<node class="Condition" id="5">
<property Operator="Equal" />
<property Opl="Self.AndroidAgent::GetState()" />
<property Opr="const State_e kBattling" />
</node>
</node>
</node>
</behavior>

View File

@ -0,0 +1,72 @@
// ---------------------------------------------------------------------
// THIS FILE IS AUTO-GENERATED BY BEHAVIAC DESIGNER, SO PLEASE DON'T MODIFY IT BY YOURSELF!
// ---------------------------------------------------------------------
#ifndef _BEHAVIAC_TYPES_H_
#define _BEHAVIAC_TYPES_H_
#include "behaviac/behaviac.h"
#include "behaviac/behaviortree/behaviortree.h"
#include "behaviac/agent/agent.h"
#include "behaviac/common/meta.h"
#include "behaviac/behaviortree/nodes/actions/action.h"
#include "behaviac/behaviortree/nodes/actions/assignment.h"
#include "behaviac/behaviortree/nodes/actions/compute.h"
#include "behaviac/behaviortree/nodes/actions/end.h"
#include "behaviac/behaviortree/nodes/actions/noop.h"
#include "behaviac/behaviortree/nodes/actions/wait.h"
#include "behaviac/behaviortree/nodes/actions/waitforsignal.h"
#include "behaviac/behaviortree/nodes/actions/waitframes.h"
#include "behaviac/behaviortree/nodes/composites/compositestochastic.h"
#include "behaviac/behaviortree/nodes/composites/ifelse.h"
#include "behaviac/behaviortree/nodes/composites/parallel.h"
#include "behaviac/behaviortree/nodes/composites/referencebehavior.h"
#include "behaviac/behaviortree/nodes/composites/selector.h"
#include "behaviac/behaviortree/nodes/composites/selectorloop.h"
#include "behaviac/behaviortree/nodes/composites/selectorprobability.h"
#include "behaviac/behaviortree/nodes/composites/selectorstochastic.h"
#include "behaviac/behaviortree/nodes/composites/sequence.h"
#include "behaviac/behaviortree/nodes/composites/sequencestochastic.h"
#include "behaviac/behaviortree/nodes/composites/withprecondition.h"
#include "behaviac/behaviortree/nodes/conditions/and.h"
#include "behaviac/behaviortree/nodes/conditions/conditionbase.h"
#include "behaviac/behaviortree/nodes/conditions/condition.h"
#include "behaviac/behaviortree/nodes/conditions/false.h"
#include "behaviac/behaviortree/nodes/conditions/or.h"
#include "behaviac/behaviortree/nodes/conditions/true.h"
#include "behaviac/behaviortree/nodes/decorators/decoratoralwaysfailure.h"
#include "behaviac/behaviortree/nodes/decorators/decoratoralwaysrunning.h"
#include "behaviac/behaviortree/nodes/decorators/decoratoralwayssuccess.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorcount.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorcountlimit.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorfailureuntil.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorframes.h"
#include "behaviac/behaviortree/nodes/decorators/decoratoriterator.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorlog.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorloop.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorloopuntil.h"
#include "behaviac/behaviortree/nodes/decorators/decoratornot.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorrepeat.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorsuccessuntil.h"
#include "behaviac/behaviortree/nodes/decorators/decoratortime.h"
#include "behaviac/behaviortree/nodes/decorators/decoratorweight.h"
#include "behaviac/behaviortree/attachments/event.h"
#include "behaviac/behaviortree/attachments/attachaction.h"
#include "behaviac/behaviortree/attachments/precondition.h"
#include "behaviac/behaviortree/attachments/effector.h"
#include "behaviac/htn/task.h"
#include "behaviac/fsm/fsm.h"
#include "behaviac/fsm/state.h"
#include "behaviac/fsm/startcondition.h"
#include "behaviac/fsm/transitioncondition.h"
#include "behaviac/fsm/waitstate.h"
#include "behaviac/fsm/waitframesstate.h"
#include "behaviac/fsm/alwaystransition.h"
#include "behaviac/fsm/waittransition.h"
#include "internal/behaviac_agent_headers.h"
#include "internal/behaviac_agent_member_visitor.h"
#include "internal/behaviac_customized_types.h"
#endif // _BEHAVIAC_TYPES_H_

View File

@ -0,0 +1,12 @@
// ---------------------------------------------------------------------
// THIS FILE IS AUTO-GENERATED BY BEHAVIAC DESIGNER, SO PLEASE DON'T MODIFY IT BY YOURSELF!
// ---------------------------------------------------------------------
#ifndef _BEHAVIAC_AGENT_HEADERS_H_
#define _BEHAVIAC_AGENT_HEADERS_H_
#include "behaviac_headers.h"
// THE FOLLOWING AGENT HEADER FILES IS GENERATED AUTOMATICALLY:
#endif // _BEHAVIAC_AGENT_HEADERS_H_

View File

@ -0,0 +1,46 @@
// ---------------------------------------------------------------------
// THIS FILE IS AUTO-GENERATED BY BEHAVIAC DESIGNER, SO PLEASE DON'T MODIFY IT BY YOURSELF!
// ---------------------------------------------------------------------
#ifndef _BEHAVIAC_MEMBER_VISITOR_H_
#define _BEHAVIAC_MEMBER_VISITOR_H_
#include "behaviac_agent_headers.h"
// Agent property and method handlers
struct METHOD_TYPE_BaseAgent_HasBuffEffect { };
template<> inline bool BaseAgent::_Execute_Method_<METHOD_TYPE_BaseAgent_HasBuffEffect>(int p0)
{
return this->BaseAgent::HasBuffEffect(p0);
}
struct METHOD_TYPE_BaseAgent_HasTarget { };
template<> inline bool BaseAgent::_Execute_Method_<METHOD_TYPE_BaseAgent_HasTarget>(float p0)
{
return this->BaseAgent::HasTarget(p0);
}
struct METHOD_TYPE_AndroidAgent_DoRandomShot { };
template<> inline behaviac::EBTStatus AndroidAgent::_Execute_Method_<METHOD_TYPE_AndroidAgent_DoRandomShot>()
{
return this->AndroidAgent::DoRandomShot();
}
struct METHOD_TYPE_AndroidAgent_GetState { };
template<> inline State_e AndroidAgent::_Execute_Method_<METHOD_TYPE_AndroidAgent_GetState>()
{
return this->AndroidAgent::GetState();
}
struct METHOD_TYPE_HeroAgent_DoAttack { };
template<> inline behaviac::EBTStatus HeroAgent::_Execute_Method_<METHOD_TYPE_HeroAgent_DoAttack>()
{
return this->HeroAgent::DoAttack();
}
#endif // _BEHAVIAC_MEMBER_VISITOR_H_

View File

@ -0,0 +1,349 @@
// ---------------------------------------------------------------------
// THIS FILE IS AUTO-GENERATED BY BEHAVIAC DESIGNER, SO PLEASE DON'T MODIFY IT BY YOURSELF!
// ---------------------------------------------------------------------
#include "behaviac/common/meta.h"
#include "behaviac/common/member.h"
#include "behaviac_agent_meta.h"
namespace behaviac
{
class CMethod_behaviac_Agent_VectorAdd : public CAgentMethodVoidBase
{
IInstanceMember* _param0;
IInstanceMember* _param1;
public:
CMethod_behaviac_Agent_VectorAdd() : _param0(0) , _param1(0)
{
}
CMethod_behaviac_Agent_VectorAdd(CMethod_behaviac_Agent_VectorAdd &rhs) : CAgentMethodVoidBase(rhs) , _param0(0) , _param1(0)
{
}
~CMethod_behaviac_Agent_VectorAdd()
{
BEHAVIAC_DELETE _param0;
BEHAVIAC_DELETE _param1;
}
virtual IInstanceMember* clone()
{
return BEHAVIAC_NEW CMethod_behaviac_Agent_VectorAdd(*this);
}
virtual void load(const char* instance, behaviac::vector<behaviac::string>& paramStrs)
{
BEHAVIAC_ASSERT(paramStrs.size() == 2);
behaviac::StringUtils::StringCopySafe(kInstanceNameMax, _instance, instance);
_param0 = AgentMeta::TParseProperty<IList >(paramStrs[0].c_str());
_param1 = AgentMeta::TParseProperty<System::Object >(paramStrs[1].c_str());
}
virtual void run(Agent* self)
{
BEHAVIAC_ASSERT(_param0 != NULL);
BEHAVIAC_ASSERT(_param1 != NULL);
IList& pValue_param0 = *(IList*)_param0->GetValue(self, behaviac::Meta::IsVector<IList >::Result, behaviac::GetClassTypeNumberId<IList >());
System::Object& pValue_param1 = *(System::Object*)_param1->GetValue(self, behaviac::Meta::IsVector<System::Object >::Result, behaviac::GetClassTypeNumberId<System::Object >());
behaviac::Agent::VectorAdd(pValue_param0, pValue_param1);
}
};
class CMethod_behaviac_Agent_VectorClear : public CAgentMethodVoidBase
{
IInstanceMember* _param0;
public:
CMethod_behaviac_Agent_VectorClear() : _param0(0)
{
}
CMethod_behaviac_Agent_VectorClear(CMethod_behaviac_Agent_VectorClear &rhs) : CAgentMethodVoidBase(rhs) , _param0(0)
{
}
~CMethod_behaviac_Agent_VectorClear()
{
BEHAVIAC_DELETE _param0;
}
virtual IInstanceMember* clone()
{
return BEHAVIAC_NEW CMethod_behaviac_Agent_VectorClear(*this);
}
virtual void load(const char* instance, behaviac::vector<behaviac::string>& paramStrs)
{
BEHAVIAC_ASSERT(paramStrs.size() == 1);
behaviac::StringUtils::StringCopySafe(kInstanceNameMax, _instance, instance);
_param0 = AgentMeta::TParseProperty<IList >(paramStrs[0].c_str());
}
virtual void run(Agent* self)
{
BEHAVIAC_ASSERT(_param0 != NULL);
IList& pValue_param0 = *(IList*)_param0->GetValue(self, behaviac::Meta::IsVector<IList >::Result, behaviac::GetClassTypeNumberId<IList >());
behaviac::Agent::VectorClear(pValue_param0);
}
};
class CMethod_behaviac_Agent_VectorContains : public CAgentMethodBase<bool>
{
IInstanceMember* _param0;
IInstanceMember* _param1;
public:
CMethod_behaviac_Agent_VectorContains() : _param0(0) , _param1(0)
{
}
CMethod_behaviac_Agent_VectorContains(CMethod_behaviac_Agent_VectorContains &rhs) : CAgentMethodBase<bool>(rhs) , _param0(0) , _param1(0)
{
}
~CMethod_behaviac_Agent_VectorContains()
{
BEHAVIAC_DELETE _param0;
BEHAVIAC_DELETE _param1;
}
virtual IInstanceMember* clone()
{
return BEHAVIAC_NEW CMethod_behaviac_Agent_VectorContains(*this);
}
virtual void load(const char* instance, behaviac::vector<behaviac::string>& paramStrs)
{
BEHAVIAC_ASSERT(paramStrs.size() == 2);
behaviac::StringUtils::StringCopySafe(kInstanceNameMax, _instance, instance);
_param0 = AgentMeta::TParseProperty<IList >(paramStrs[0].c_str());
_param1 = AgentMeta::TParseProperty<System::Object >(paramStrs[1].c_str());
}
virtual void run(Agent* self)
{
BEHAVIAC_ASSERT(_param0 != NULL);
BEHAVIAC_ASSERT(_param1 != NULL);
IList& pValue_param0 = *(IList*)_param0->GetValue(self, behaviac::Meta::IsVector<IList >::Result, behaviac::GetClassTypeNumberId<IList >());
System::Object& pValue_param1 = *(System::Object*)_param1->GetValue(self, behaviac::Meta::IsVector<System::Object >::Result, behaviac::GetClassTypeNumberId<System::Object >());
_returnValue->value = behaviac::Agent::VectorContains(pValue_param0, pValue_param1);
}
};
class CMethod_behaviac_Agent_VectorLength : public CAgentMethodBase<int>
{
IInstanceMember* _param0;
public:
CMethod_behaviac_Agent_VectorLength() : _param0(0)
{
}
CMethod_behaviac_Agent_VectorLength(CMethod_behaviac_Agent_VectorLength &rhs) : CAgentMethodBase<int>(rhs) , _param0(0)
{
}
~CMethod_behaviac_Agent_VectorLength()
{
BEHAVIAC_DELETE _param0;
}
virtual IInstanceMember* clone()
{
return BEHAVIAC_NEW CMethod_behaviac_Agent_VectorLength(*this);
}
virtual void load(const char* instance, behaviac::vector<behaviac::string>& paramStrs)
{
BEHAVIAC_ASSERT(paramStrs.size() == 1);
behaviac::StringUtils::StringCopySafe(kInstanceNameMax, _instance, instance);
_param0 = AgentMeta::TParseProperty<IList >(paramStrs[0].c_str());
}
virtual void run(Agent* self)
{
BEHAVIAC_ASSERT(_param0 != NULL);
IList& pValue_param0 = *(IList*)_param0->GetValue(self, behaviac::Meta::IsVector<IList >::Result, behaviac::GetClassTypeNumberId<IList >());
_returnValue->value = behaviac::Agent::VectorLength(pValue_param0);
}
};
class CMethod_behaviac_Agent_VectorRemove : public CAgentMethodVoidBase
{
IInstanceMember* _param0;
IInstanceMember* _param1;
public:
CMethod_behaviac_Agent_VectorRemove() : _param0(0) , _param1(0)
{
}
CMethod_behaviac_Agent_VectorRemove(CMethod_behaviac_Agent_VectorRemove &rhs) : CAgentMethodVoidBase(rhs) , _param0(0) , _param1(0)
{
}
~CMethod_behaviac_Agent_VectorRemove()
{
BEHAVIAC_DELETE _param0;
BEHAVIAC_DELETE _param1;
}
virtual IInstanceMember* clone()
{
return BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove(*this);
}
virtual void load(const char* instance, behaviac::vector<behaviac::string>& paramStrs)
{
BEHAVIAC_ASSERT(paramStrs.size() == 2);
behaviac::StringUtils::StringCopySafe(kInstanceNameMax, _instance, instance);
_param0 = AgentMeta::TParseProperty<IList >(paramStrs[0].c_str());
_param1 = AgentMeta::TParseProperty<System::Object >(paramStrs[1].c_str());
}
virtual void run(Agent* self)
{
BEHAVIAC_ASSERT(_param0 != NULL);
BEHAVIAC_ASSERT(_param1 != NULL);
IList& pValue_param0 = *(IList*)_param0->GetValue(self, behaviac::Meta::IsVector<IList >::Result, behaviac::GetClassTypeNumberId<IList >());
System::Object& pValue_param1 = *(System::Object*)_param1->GetValue(self, behaviac::Meta::IsVector<System::Object >::Result, behaviac::GetClassTypeNumberId<System::Object >());
behaviac::Agent::VectorRemove(pValue_param0, pValue_param1);
}
};
class BehaviorLoaderImplement : BehaviorLoader
{
public:
BehaviorLoaderImplement()
{
AgentMeta::SetBehaviorLoader(this);
}
virtual ~BehaviorLoaderImplement()
{
}
virtual bool load()
{
AgentMeta::SetTotalSignature(3970666413u);
AgentMeta* meta = NULL;
BEHAVIAC_UNUSED_VAR(meta);
// behaviac::Agent
meta = BEHAVIAC_NEW AgentMeta(24743406u);
AgentMeta::GetAgentMetas()[1770892321u] = meta;
meta->RegisterMethod(1045109914u, BEHAVIAC_NEW CAgentStaticMethodVoid_1<char*>(FunctionPointer_behaviac_Agent_LogMessage));
meta->RegisterMethod(2521019022u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorAdd());
meta->RegisterMethod(2306090221u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorClear());
meta->RegisterMethod(3483755530u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorContains());
meta->RegisterMethod(505785840u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorLength());
meta->RegisterMethod(502968959u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove());
// BaseAgent
meta = BEHAVIAC_NEW AgentMeta(4035532781u);
AgentMeta::GetAgentMetas()[2774251291u] = meta;
meta->RegisterMethod(623091365u, BEHAVIAC_NEW CAgentMethod_1< behaviac::EBTStatus, int >(FunctionPointer_BaseAgent_CoAttackTarget));
meta->RegisterMethod(3603629747u, BEHAVIAC_NEW CAgentMethod_1< bool, int >(FunctionPointer_BaseAgent_HasBuffEffect));
meta->RegisterMethod(3047011226u, BEHAVIAC_NEW CAgentMethod_1< bool, float >(FunctionPointer_BaseAgent_HasTarget));
meta->RegisterMethod(400482748u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_BaseAgent_IsGameOver));
meta->RegisterMethod(1045109914u, BEHAVIAC_NEW CAgentStaticMethodVoid_1<char*>(FunctionPointer_BaseAgent_LogMessage));
meta->RegisterMethod(3111585017u, BEHAVIAC_NEW CAgentMethodVoid_2<int, int>(FunctionPointer_BaseAgent_OnAttacked) /* OnAttacked */);
meta->RegisterMethod(2521019022u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorAdd());
meta->RegisterMethod(2306090221u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorClear());
meta->RegisterMethod(3483755530u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorContains());
meta->RegisterMethod(505785840u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorLength());
meta->RegisterMethod(502968959u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove());
// AndroidAgent
meta = BEHAVIAC_NEW AgentMeta(3677158988u);
AgentMeta::GetAgentMetas()[2475098143u] = meta;
meta->RegisterMethod(623091365u, BEHAVIAC_NEW CAgentMethod_1< behaviac::EBTStatus, int >(FunctionPointer_AndroidAgent_CoAttackTarget));
meta->RegisterMethod(2886181657u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_AndroidAgent_DoAttack));
meta->RegisterMethod(2062982811u, BEHAVIAC_NEW CAgentMethod_2< behaviac::EBTStatus, int, int >(FunctionPointer_AndroidAgent_DoIdle));
meta->RegisterMethod(846782702u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_AndroidAgent_DoPursuit));
meta->RegisterMethod(1079343198u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_AndroidAgent_DoRandomShot));
meta->RegisterMethod(130097619u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_AndroidAgent_DoRandomWalk));
meta->RegisterMethod(1666360340u, BEHAVIAC_NEW CAgentMethod< State_e >(FunctionPointer_AndroidAgent_GetState));
meta->RegisterMethod(3603629747u, BEHAVIAC_NEW CAgentMethod_1< bool, int >(FunctionPointer_AndroidAgent_HasBuffEffect));
meta->RegisterMethod(3047011226u, BEHAVIAC_NEW CAgentMethod_1< bool, float >(FunctionPointer_AndroidAgent_HasTarget));
meta->RegisterMethod(400482748u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_AndroidAgent_IsGameOver));
meta->RegisterMethod(1045109914u, BEHAVIAC_NEW CAgentStaticMethodVoid_1<char*>(FunctionPointer_AndroidAgent_LogMessage));
meta->RegisterMethod(3111585017u, BEHAVIAC_NEW CAgentMethodVoid_2<int, int>(FunctionPointer_AndroidAgent_OnAttacked) /* OnAttacked */);
meta->RegisterMethod(2521019022u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorAdd());
meta->RegisterMethod(2306090221u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorClear());
meta->RegisterMethod(3483755530u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorContains());
meta->RegisterMethod(505785840u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorLength());
meta->RegisterMethod(502968959u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove());
// HeroAgent
meta = BEHAVIAC_NEW AgentMeta(2036826139u);
AgentMeta::GetAgentMetas()[2270112014u] = meta;
meta->RegisterMethod(623091365u, BEHAVIAC_NEW CAgentMethod_1< behaviac::EBTStatus, int >(FunctionPointer_HeroAgent_CoAttackTarget));
meta->RegisterMethod(2886181657u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_HeroAgent_DoAttack));
meta->RegisterMethod(2062982811u, BEHAVIAC_NEW CAgentMethod_2< EBTStatus, int, int >(FunctionPointer_HeroAgent_DoIdle));
meta->RegisterMethod(846782702u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_HeroAgent_DoPursuit));
meta->RegisterMethod(1079343198u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_HeroAgent_DoRandomShot));
meta->RegisterMethod(130097619u, BEHAVIAC_NEW CAgentMethod< behaviac::EBTStatus >(FunctionPointer_HeroAgent_DoRandomWalk));
meta->RegisterMethod(3603629747u, BEHAVIAC_NEW CAgentMethod_1< bool, int >(FunctionPointer_HeroAgent_HasBuffEffect));
meta->RegisterMethod(3047011226u, BEHAVIAC_NEW CAgentMethod_1< bool, float >(FunctionPointer_HeroAgent_HasTarget));
meta->RegisterMethod(400482748u, BEHAVIAC_NEW CAgentMethod< bool >(FunctionPointer_HeroAgent_IsGameOver));
meta->RegisterMethod(1045109914u, BEHAVIAC_NEW CAgentStaticMethodVoid_1<char*>(FunctionPointer_HeroAgent_LogMessage));
meta->RegisterMethod(3111585017u, BEHAVIAC_NEW CAgentMethodVoid_2<int, int>(FunctionPointer_HeroAgent_OnAttacked) /* OnAttacked */);
meta->RegisterMethod(2521019022u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorAdd());
meta->RegisterMethod(2306090221u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorClear());
meta->RegisterMethod(3483755530u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorContains());
meta->RegisterMethod(505785840u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorLength());
meta->RegisterMethod(502968959u, BEHAVIAC_NEW CMethod_behaviac_Agent_VectorRemove());
AgentMeta::Register<behaviac::Agent>("behaviac::Agent");
AgentMeta::Register<BaseAgent>("BaseAgent");
AgentMeta::Register<AndroidAgent>("AndroidAgent");
AgentMeta::Register<HeroAgent>("HeroAgent");
AgentMeta::Register<State_e>("State_e");
return true;
}
virtual bool unLoad()
{
AgentMeta::UnRegister<behaviac::Agent>("behaviac::Agent");
AgentMeta::UnRegister<BaseAgent>("BaseAgent");
AgentMeta::UnRegister<AndroidAgent>("AndroidAgent");
AgentMeta::UnRegister<HeroAgent>("HeroAgent");
AgentMeta::UnRegister<State_e>("State_e");
return true;
}
};
static BehaviorLoaderImplement _behaviorLoaderImplement_;
static BehaviorLoaderImplement* _pBehaviorLoader_ = NULL;
void InitBehaviorLoader()
{
_pBehaviorLoader_ = BEHAVIAC_NEW BehaviorLoaderImplement();
}
void DestroyBehaviorLoader()
{
if (_pBehaviorLoader_)
{
BEHAVIAC_DELETE _pBehaviorLoader_;
_pBehaviorLoader_ = NULL;
}
}
}

View File

@ -0,0 +1,49 @@
// ---------------------------------------------------------------------
// THIS FILE IS AUTO-GENERATED BY BEHAVIAC DESIGNER, SO PLEASE DON'T MODIFY IT BY YOURSELF!
// ---------------------------------------------------------------------
#ifndef _BEHAVIAC_AGENT_PROPERTIES_H_
#define _BEHAVIAC_AGENT_PROPERTIES_H_
#include "behaviac_agent_headers.h"
#include "behaviac_agent_member_visitor.h"
#include "behaviac_customized_types.h"
namespace behaviac
{
// ---------------------------------------------------------------------
// Delegate methods
// ---------------------------------------------------------------------
inline void FunctionPointer_behaviac_Agent_LogMessage(char* param0) { behaviac::Agent::LogMessage(param0); }
inline behaviac::EBTStatus FunctionPointer_BaseAgent_CoAttackTarget(Agent* self, int target_id) { return ((BaseAgent*)self)->CoAttackTarget(target_id); }
inline bool FunctionPointer_BaseAgent_HasBuffEffect(Agent* self, int buff_effect) { return (bool)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_HasBuffEffect, bool, int >(buff_effect); }
inline bool FunctionPointer_BaseAgent_HasTarget(Agent* self, float range) { return (bool)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_HasTarget, bool, float >(range); }
inline bool FunctionPointer_BaseAgent_IsGameOver(Agent* self) { return ((BaseAgent*)self)->IsGameOver(); }
inline void FunctionPointer_BaseAgent_LogMessage(char* param0) { BaseAgent::LogMessage(param0); }
inline void FunctionPointer_BaseAgent_OnAttacked(Agent* self, int sender, int time) { } /* OnAttacked */
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_CoAttackTarget(Agent* self, int target_id) { return ((AndroidAgent*)self)->CoAttackTarget(target_id); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_DoAttack(Agent* self) { return ((AndroidAgent*)self)->DoAttack(); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_DoIdle(Agent* self, int min_time, int max_time) { return ((AndroidAgent*)self)->DoIdle(min_time, max_time); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_DoPursuit(Agent* self) { return ((AndroidAgent*)self)->DoPursuit(); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_DoRandomShot(Agent* self) { return (behaviac::EBTStatus)((AndroidAgent*)self)->_Execute_Method_<METHOD_TYPE_AndroidAgent_DoRandomShot, behaviac::EBTStatus >(); }
inline behaviac::EBTStatus FunctionPointer_AndroidAgent_DoRandomWalk(Agent* self) { return ((AndroidAgent*)self)->DoRandomWalk(); }
inline State_e FunctionPointer_AndroidAgent_GetState(Agent* self) { return (State_e)((AndroidAgent*)self)->_Execute_Method_<METHOD_TYPE_AndroidAgent_GetState, State_e >(); }
inline bool FunctionPointer_AndroidAgent_HasBuffEffect(Agent* self, int buff_effect) { return (bool)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_HasBuffEffect, bool, int >(buff_effect); }
inline bool FunctionPointer_AndroidAgent_HasTarget(Agent* self, float range) { return (bool)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_HasTarget, bool, float >(range); }
inline bool FunctionPointer_AndroidAgent_IsGameOver(Agent* self) { return ((AndroidAgent*)self)->IsGameOver(); }
inline void FunctionPointer_AndroidAgent_LogMessage(char* param0) { AndroidAgent::LogMessage(param0); }
inline void FunctionPointer_AndroidAgent_OnAttacked(Agent* self, int sender, int time) { } /* OnAttacked */
inline behaviac::EBTStatus FunctionPointer_HeroAgent_CoAttackTarget(Agent* self, int target_id) { return ((HeroAgent*)self)->CoAttackTarget(target_id); }
inline behaviac::EBTStatus FunctionPointer_HeroAgent_DoAttack(Agent* self) { return (behaviac::EBTStatus)((HeroAgent*)self)->_Execute_Method_<METHOD_TYPE_HeroAgent_DoAttack, behaviac::EBTStatus >(); }
inline EBTStatus FunctionPointer_HeroAgent_DoIdle(Agent* self, int min_time, int max_time) { return ((HeroAgent*)self)->DoIdle(min_time, max_time); }
inline behaviac::EBTStatus FunctionPointer_HeroAgent_DoPursuit(Agent* self) { return ((HeroAgent*)self)->DoPursuit(); }
inline behaviac::EBTStatus FunctionPointer_HeroAgent_DoRandomShot(Agent* self) { return ((HeroAgent*)self)->DoRandomShot(); }
inline behaviac::EBTStatus FunctionPointer_HeroAgent_DoRandomWalk(Agent* self) { return ((HeroAgent*)self)->DoRandomWalk(); }
inline bool FunctionPointer_HeroAgent_HasBuffEffect(Agent* self, int buff_effect) { return (bool)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_HasBuffEffect, bool, int >(buff_effect); }
inline bool FunctionPointer_HeroAgent_HasTarget(Agent* self, float range) { return (bool)((BaseAgent*)self)->_Execute_Method_<METHOD_TYPE_BaseAgent_HasTarget, bool, float >(range); }
inline bool FunctionPointer_HeroAgent_IsGameOver(Agent* self) { return ((HeroAgent*)self)->IsGameOver(); }
inline void FunctionPointer_HeroAgent_LogMessage(char* param0) { HeroAgent::LogMessage(param0); }
inline void FunctionPointer_HeroAgent_OnAttacked(Agent* self, int sender, int time) { } /* OnAttacked */
}
#endif // _BEHAVIAC_AGENT_PROPERTIES_H_

View File

@ -0,0 +1,21 @@
// ---------------------------------------------------------------------
// THIS FILE IS AUTO-GENERATED BY BEHAVIAC DESIGNER, SO PLEASE DON'T MODIFY IT BY YOURSELF!
// ---------------------------------------------------------------------
#include "../behaviac_types.h"
// -------------------
// Customized enums
// -------------------
BEHAVIAC_BEGIN_ENUM_EX(State_e, State_e)
{
BEHAVIAC_ENUMCLASS_DISPLAY_INFO_EX(L"State_e", L"");
BEHAVIAC_ENUM_ITEM_EX(kPreBattle, "kPreBattle");
BEHAVIAC_ENUM_ITEM_EX(kFly, "kFly");
BEHAVIAC_ENUM_ITEM_EX(kJump, "kJump");
BEHAVIAC_ENUM_ITEM_EX(kBattling, "kBattling");
}
BEHAVIAC_END_ENUM_EX()

View File

@ -0,0 +1,26 @@
// ---------------------------------------------------------------------
// THIS FILE IS AUTO-GENERATED BY BEHAVIAC DESIGNER, SO PLEASE DON'T MODIFY IT BY YOURSELF!
// ---------------------------------------------------------------------
#ifndef _BEHAVIAC_CUSTOMIZED_TYPES_H_
#define _BEHAVIAC_CUSTOMIZED_TYPES_H_
#include "behaviac/agent/agent.h"
// -------------------
// Customized enums
// -------------------
enum State_e
{
kPreBattle = 1,
kFly = 2,
kJump = 3,
kBattling = 4,
};
DECLARE_BEHAVIAC_ENUM_EX(State_e, State_e);
BEHAVIAC_DECLARE_TYPE_VECTOR_HANDLER(State_e);
#endif // _BEHAVIAC_CUSTOMIZED_TYPES_H_

View File

@ -0,0 +1,17 @@
// ---------------------------------------------------------------------
// THIS FILE IS AUTO-GENERATED BY BEHAVIAC DESIGNER, SO PLEASE DON'T MODIFY IT BY YOURSELF!
// ---------------------------------------------------------------------
#ifndef _BEHAVIAC_HEADERS_H_
#define _BEHAVIAC_HEADERS_H_
#include "behaviac/behaviac.h"
// YOU SHOULD SET THE HEADER FILES OF YOUR GAME WHEN EXPORTING CPP FILES ON THE BEHAVIAC EDITOR:
#include "base_agent.h"
#include "android_agent.h"
#include "hero_agent.h"
#include "behaviac_customized_types.h"
#endif // _BEHAVIAC_HEADERS_H_

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: hero_9011.xml-->
<behavior name="hero_9011" agenttype="HeroAgent" version="5">
<node class="IfElse" id="0">
<node class="Condition" id="1">
<property Operator="NotEqual" />
<property Opl="Self.BaseAgent::HasBuffEffect(3)" />
<property Opr="const bool true" />
</node>
<node class="Action" id="2">
<property Method="Self.HeroAgent::DoAttack()" />
<property ResultOption="BT_INVALID" />
</node>
<node class="True" id="3" />
</node>
</behavior>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: hero_pve_01.xml-->
<behavior name="hero_pve_01" agenttype="HeroAgent" version="5">
<node class="Action" id="0">
<property Method="Self.HeroAgent::DoRandomWalk()" />
<property ResultOption="BT_INVALID" />
</node>
</behavior>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<!--Source File: hero_pve_02.xml-->
<behavior name="hero_pve_02" agenttype="HeroAgent" version="5">
<node class="Action" id="0">
<property Method="Self.HeroAgent::DoPursuit()" />
<property ResultOption="BT_INVALID" />
</node>
</behavior>

View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!--EXPORTED BY TOOL, DON'T MODIFY IT!-->
<agents version="1" signature="3970666413" />