Exemplo n.º 1
0
        /// <summary>
        /// Initializes scripts
        /// </summary>
        public override bool init()
        {
            EventObjects.eventInit(this, true);

            //Load the associated scripts
            _scripts = Scripts.instanceScripts(this, _scriptType);


            //If the bot implementes a BT, load it and use it.
            _BehaviorTrees = new List <TreeSharp.Composite>();
            if (exists(BT_EVENT_KEY))
            {
                //Grab all handlers (could be more then one BT).
                foreach (var mthHandler in events[BT_EVENT_KEY].methods)
                {
                    TreeSharp.Composite x = mthHandler.handler(mthHandler.that, null) as TreeSharp.Composite;
                    x.Start(null);
                    _BehaviorTrees.Add(x);
                }
            }


            return(true);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes events for the event object
 /// </summary>
 public void eventInit(bool bParseEvents)
 {
     EventObjects.eventInit(this, bParseEvents);
 }