Exemple #1
0
        public static void TestLongField()
        {
            AgentData agent = new AgentData();

            agent.StartNode = new NodeData();

            LongField longField = new LongField();

            longField.FieldName = "LongField";
            longField.Value     = 100;
            agent.StartNode.Fields.Add(longField);

            RepeatLongField repeatLongField = new RepeatLongField();

            repeatLongField.FieldName = "RepeatLongField";
            repeatLongField.Value     = new List <long>();
            repeatLongField.Value.Add(1);
            repeatLongField.Value.Add(100);
            repeatLongField.Value.Add(1000);
            repeatLongField.Value.Add(10000);
            agent.StartNode.Fields.Add(repeatLongField);

            byte[]    bytes       = Serializer.Serialize(agent);
            AgentData deAgentData = Serializer.DeSerialize <AgentData>(bytes);
        }
Exemple #2
0
        public static void TestLongField()
        {
            BehaviorTreeElement behaviorTree = new BehaviorTreeElement();

            behaviorTree.StartNode = new NodeData();

            LongField longField = new LongField();

            longField.FieldName = "LongField";
            longField.Value     = 100;
            behaviorTree.StartNode.Fields.Add(longField);

            RepeatLongField repeatLongField = new RepeatLongField();

            repeatLongField.FieldName = "RepeatLongField";
            repeatLongField.Value     = new List <long>();
            repeatLongField.Value.Add(1);
            repeatLongField.Value.Add(100);
            repeatLongField.Value.Add(1000);
            repeatLongField.Value.Add(10000);
            behaviorTree.StartNode.Fields.Add(repeatLongField);

            byte[] bytes = Serializer.Serialize(behaviorTree);
            BehaviorTreeElement deBehaviorTreeData = Serializer.DeSerialize <BehaviorTreeElement>(bytes);
        }