示例#1
0
		public static bool build_behavior_tree(BehaviorTree bt)
		{
			bt.SetClassNameString("BehaviorTree");
			bt.SetId(-1);
			bt.SetName("node_test/htn/travel/travel");
			bt.IsFSM = false;
#if !BEHAVIAC_RELEASE
			bt.SetAgentType("HTNAgentTravel");
#endif
			// pars
			bt.AddPar("HTNAgentTravel", "int", "_$local_task_param_$_0", "0");
			bt.AddPar("HTNAgentTravel", "int", "_$local_task_param_$_1", "0");
			// children
			{
				Task_bt_node_test_htn_travel_travel_node0 node0 = new Task_bt_node_test_htn_travel_travel_node0();
				node0.SetClassNameString("Task");
				node0.SetId(0);
#if !BEHAVIAC_RELEASE
				node0.SetAgentType("HTNAgentTravel");
#endif
				bt.AddChild(node0);
				{
					Method node2 = new Method();
					node2.SetClassNameString("Method");
					node2.SetId(2);
#if !BEHAVIAC_RELEASE
					node2.SetAgentType("HTNAgentTravel");
#endif
					// attachments
					{
						Precondition_bt_node_test_htn_travel_travel_attach1 attach1 = new Precondition_bt_node_test_htn_travel_travel_attach1();
						attach1.SetClassNameString("Precondition");
						attach1.SetId(1);
#if !BEHAVIAC_RELEASE
						attach1.SetAgentType("HTNAgentTravel");
#endif
						node2.Attach(attach1, true, false, false);
					}
					node0.AddChild(node2);
					{
						Action_bt_node_test_htn_travel_travel_node3 node3 = new Action_bt_node_test_htn_travel_travel_node3();
						node3.SetClassNameString("Action");
						node3.SetId(3);
#if !BEHAVIAC_RELEASE
						node3.SetAgentType("HTNAgentTravel");
#endif
						node2.AddChild(node3);
						node2.SetHasEvents(node2.HasEvents() | node3.HasEvents());
					}
					node0.SetHasEvents(node0.HasEvents() | node2.HasEvents());
				}
				{
					Method node5 = new Method();
					node5.SetClassNameString("Method");
					node5.SetId(5);
#if !BEHAVIAC_RELEASE
					node5.SetAgentType("HTNAgentTravel");
#endif
					// attachments
					{
						Precondition_bt_node_test_htn_travel_travel_attach4 attach4 = new Precondition_bt_node_test_htn_travel_travel_attach4();
						attach4.SetClassNameString("Precondition");
						attach4.SetId(4);
#if !BEHAVIAC_RELEASE
						attach4.SetAgentType("HTNAgentTravel");
#endif
						node5.Attach(attach4, true, false, false);
					}
					node0.AddChild(node5);
					{
						ReferencedBehavior_bt_node_test_htn_travel_travel_node6 node6 = new ReferencedBehavior_bt_node_test_htn_travel_travel_node6();
						node6.SetClassNameString("ReferencedBehavior");
						node6.SetId(6);
#if !BEHAVIAC_RELEASE
						node6.SetAgentType("HTNAgentTravel");
#endif
						node5.AddChild(node6);
						node5.SetHasEvents(node5.HasEvents() | node6.HasEvents());
					}
					node0.SetHasEvents(node0.HasEvents() | node5.HasEvents());
				}
				bt.SetHasEvents(bt.HasEvents() | node0.HasEvents());
			}
			return true;
		}
示例#2
0
		public static bool build_behavior_tree(BehaviorTree bt)
		{
			bt.SetClassNameString("BehaviorTree");
			bt.SetId(-1);
			bt.SetName("node_test/htn/travel/travel_by_air");
			bt.IsFSM = false;
#if !BEHAVIAC_RELEASE
			bt.SetAgentType("HTNAgentTravel");
#endif
			// pars
			bt.AddPar("HTNAgentTravel", "int", "ax", "0");
			bt.AddPar("HTNAgentTravel", "int", "ay", "0");
			bt.AddPar("HTNAgentTravel", "vector<int>", "as", "0:");
			bt.AddPar("HTNAgentTravel", "int", "_$local_task_param_$_0", "0");
			bt.AddPar("HTNAgentTravel", "int", "_$local_task_param_$_1", "0");
			// children
			{
				Task_bt_node_test_htn_travel_travel_by_air_node0 node0 = new Task_bt_node_test_htn_travel_travel_by_air_node0();
				node0.SetClassNameString("Task");
				node0.SetId(0);
#if !BEHAVIAC_RELEASE
				node0.SetAgentType("HTNAgentTravel");
#endif
				bt.AddChild(node0);
				{
					Method node1 = new Method();
					node1.SetClassNameString("Method");
					node1.SetId(1);
#if !BEHAVIAC_RELEASE
					node1.SetAgentType("HTNAgentTravel");
#endif
					// attachments
					{
						Precondition_bt_node_test_htn_travel_travel_by_air_attach2 attach2 = new Precondition_bt_node_test_htn_travel_travel_by_air_attach2();
						attach2.SetClassNameString("Precondition");
						attach2.SetId(2);
#if !BEHAVIAC_RELEASE
						attach2.SetAgentType("HTNAgentTravel");
#endif
						node1.Attach(attach2, true, false, false);
					}
					{
						Precondition_bt_node_test_htn_travel_travel_by_air_attach3 attach3 = new Precondition_bt_node_test_htn_travel_travel_by_air_attach3();
						attach3.SetClassNameString("Precondition");
						attach3.SetId(3);
#if !BEHAVIAC_RELEASE
						attach3.SetAgentType("HTNAgentTravel");
#endif
						node1.Attach(attach3, true, false, false);
					}
					node0.AddChild(node1);
					{
						DecoratorIterator_bt_node_test_htn_travel_travel_by_air_node5 node5 = new DecoratorIterator_bt_node_test_htn_travel_travel_by_air_node5();
						node5.SetClassNameString("DecoratorIterator");
						node5.SetId(5);
#if !BEHAVIAC_RELEASE
						node5.SetAgentType("HTNAgentTravel");
#endif
						node1.AddChild(node5);
						{
							Sequence node6 = new Sequence();
							node6.SetClassNameString("Sequence");
							node6.SetId(6);
#if !BEHAVIAC_RELEASE
							node6.SetAgentType("HTNAgentTravel");
#endif
							node5.AddChild(node6);
							{
								ReferencedBehavior_bt_node_test_htn_travel_travel_by_air_node8 node8 = new ReferencedBehavior_bt_node_test_htn_travel_travel_by_air_node8();
								node8.SetClassNameString("ReferencedBehavior");
								node8.SetId(8);
#if !BEHAVIAC_RELEASE
								node8.SetAgentType("HTNAgentTravel");
#endif
								node6.AddChild(node8);
								node6.SetHasEvents(node6.HasEvents() | node8.HasEvents());
							}
							{
								Action_bt_node_test_htn_travel_travel_by_air_node7 node7 = new Action_bt_node_test_htn_travel_travel_by_air_node7();
								node7.SetClassNameString("Action");
								node7.SetId(7);
#if !BEHAVIAC_RELEASE
								node7.SetAgentType("HTNAgentTravel");
#endif
								node6.AddChild(node7);
								node6.SetHasEvents(node6.HasEvents() | node7.HasEvents());
							}
							{
								ReferencedBehavior_bt_node_test_htn_travel_travel_by_air_node4 node4 = new ReferencedBehavior_bt_node_test_htn_travel_travel_by_air_node4();
								node4.SetClassNameString("ReferencedBehavior");
								node4.SetId(4);
#if !BEHAVIAC_RELEASE
								node4.SetAgentType("HTNAgentTravel");
#endif
								node6.AddChild(node4);
								node6.SetHasEvents(node6.HasEvents() | node4.HasEvents());
							}
							node5.SetHasEvents(node5.HasEvents() | node6.HasEvents());
						}
						node1.SetHasEvents(node1.HasEvents() | node5.HasEvents());
					}
					node0.SetHasEvents(node0.HasEvents() | node1.HasEvents());
				}
				bt.SetHasEvents(bt.HasEvents() | node0.HasEvents());
			}
			return true;
		}
示例#3
0
		public static bool build_behavior_tree(BehaviorTree bt)
		{
			bt.SetClassNameString("BehaviorTree");
			bt.SetId(-1);
			bt.SetName("node_test/htn/travel/root");
			bt.IsFSM = false;
#if !BEHAVIAC_RELEASE
			bt.SetAgentType("HTNAgentTravel");
#endif
			// pars
			bt.AddPar("HTNAgentTravel", "int", "start", "0");
			bt.AddPar("HTNAgentTravel", "int", "finish", "0");
			// children
			{
				Task_bt_node_test_htn_travel_root_node1 node1 = new Task_bt_node_test_htn_travel_root_node1();
				node1.SetClassNameString("Task");
				node1.SetId(1);
#if !BEHAVIAC_RELEASE
				node1.SetAgentType("HTNAgentTravel");
#endif
				bt.AddChild(node1);
				{
					Method node2 = new Method();
					node2.SetClassNameString("Method");
					node2.SetId(2);
#if !BEHAVIAC_RELEASE
					node2.SetAgentType("HTNAgentTravel");
#endif
					// attachments
					{
						Precondition_bt_node_test_htn_travel_root_attach0 attach0 = new Precondition_bt_node_test_htn_travel_root_attach0();
						attach0.SetClassNameString("Precondition");
						attach0.SetId(0);
#if !BEHAVIAC_RELEASE
						attach0.SetAgentType("HTNAgentTravel");
#endif
						node2.Attach(attach0, true, false, false);
					}
					{
						Precondition_bt_node_test_htn_travel_root_attach3 attach3 = new Precondition_bt_node_test_htn_travel_root_attach3();
						attach3.SetClassNameString("Precondition");
						attach3.SetId(3);
#if !BEHAVIAC_RELEASE
						attach3.SetAgentType("HTNAgentTravel");
#endif
						node2.Attach(attach3, true, false, false);
					}
					node1.AddChild(node2);
					{
						ReferencedBehavior_bt_node_test_htn_travel_root_node4 node4 = new ReferencedBehavior_bt_node_test_htn_travel_root_node4();
						node4.SetClassNameString("ReferencedBehavior");
						node4.SetId(4);
#if !BEHAVIAC_RELEASE
						node4.SetAgentType("HTNAgentTravel");
#endif
						node2.AddChild(node4);
						node2.SetHasEvents(node2.HasEvents() | node4.HasEvents());
					}
					node1.SetHasEvents(node1.HasEvents() | node2.HasEvents());
				}
				bt.SetHasEvents(bt.HasEvents() | node1.HasEvents());
			}
			return true;
		}