Esempio n. 1
0
        public static CAIBehaviorDescr CreateTestObject(string name)
        {
            var descr = new CAIBehaviorDescr();

            descr._behavior_name           = name;
            descr._ai_signal               = EAISignalType.MessageReply;
            descr._ai_signal_message_name  = "msg_name";
            descr._ai_signal_message_reply = "msg_reply";

            descr._cond_aliases = new string[, ] {
                { "cond1", "cond2" }, { "cond3", "cond4" }
            };
            descr._reset_behavior_cond_aliases = new string[, ] {
                { "cond11" }
            };

            descr._action_descrs = new CAIActionDescrs[]
            {
                CAIActionDescrs.CreateTestObject(),
                    CAIActionDescrs.CreateTestObject()
            };
            descr._priority = 7;

            return(descr);
        }
Esempio n. 2
0
        internal static CAIBrainDescr CreateTestObject()
        {
            var descr = new CAIBrainDescr();

            descr._person_names         = new string[] { "PersonName1", "PersonName2" };
            descr._start_invisible      = true;
            descr._stringGroupOverrides = new CStringGroupDescr[]
            {
                new CStringGroupDescr("SGO1", new string[] { "sgo_text1", "sgo_text2" }),
                new CStringGroupDescr("SGO2", new string[] { "sgo_text3", "sgo_text4" })
            };
            descr.Conditions = new CAIBehaviorConditionDescr[]
            {
                CAIBehaviorConditionDescr.CreateTestObject()
            };
            descr.BehaviorDescrs = new CAIBehaviorDescr[]
            {
                CAIBehaviorDescr.CreateTestObject("behav1"),
                CAIBehaviorDescr.CreateTestObject("behav2"),
            };

            descr._oncrash_actionDescrs = new List <CAIActionDescrs>()
            {
                CAIActionDescrs.CreateTestObject()
            };
            descr._loc_keys = new CAILocKeys(new EBehaviourReportParam[] { EBehaviourReportParam.CurrentBehaviourActiveTime, EBehaviourReportParam.CurrentWorldTime });
            descr._states   = new CAIBehaviorStateDescr[]
            {
                CAIBehaviorStateDescr.CreateTestObject("state1"),
                CAIBehaviorStateDescr.CreateTestObject("state2"),
            };

            return(descr);
        }
Esempio n. 3
0
        public static CAIActionDescrs CreateTestObject()
        {
            CAIActionDescrs obj = new CAIActionDescrs();

            obj.Add("aikey", "aivalue");
            return(obj);
        }
Esempio n. 4
0
 public void Init1()
 {
     _action_descrs = new CAIActionDescrs[]
     {
         CAIActionDescrs.CreateTestObject(),
             CAIActionDescrs.CreateTestObject()
     };
 }
Esempio n. 5
0
        public void TestMethodDicInheriteWithoutFieldTwoRec()
        {
            ResetTestState();
            Console.WriteLine(MethodBase.GetCurrentMethod().Name);
            var v1 = new CAIActionDescrs();

            v1.Init2();

            string text = _serializer.SerializeToCascade(v1, this);

            Console.WriteLine(text);
            var v2 = _serializer.Deserialize <CAIActionDescrs>(text, this);

            CheckInternalErrors();
            Assert.AreEqual(v1, v2);
        }
Esempio n. 6
0
        public static CAIBehaviorStateDescr CreateTestObject(string name)
        {
            var descr = new CAIBehaviorStateDescr();

            descr._state_name    = name;
            descr._action_descrs = new CAIActionDescrs[]
            {
                CAIActionDescrs.CreateTestObject(),
                    CAIActionDescrs.CreateTestObject()
            };
            descr._next_states = new CNextStatesDescr[]
            {
                new CNextStatesDescr("next_state1", new string[, ] {
                    { "cond1", "cond2" }, { "cond3", "cond4" }
                }),
                new CNextStatesDescr("next_state2", new string[, ] {
                    { "cond11" }
                })
            };
            descr._state_index = -1;

            return(descr);
        }