public virtual BTEvent Clone()
        {
            BTEvent newObject = new BTEvent();

            newObject.Name     = this.Name;
            newObject.group_id = this.group_id;
            newObject.cost     = this.cost;
            newObject.root     = this.root;
            return(newObject);
        }
        // generate event that the precondition has been satisfied
        private List <EventInstance> event_availible()
        {
            List <EventInstance> res = new List <EventInstance>();

            foreach (var item in events)
            {
                BTEvent tmp = item.Value;
                foreach (var group in event_actor_combination[item.Key])
                {
                    tmp.set_participants(group);
                    if (tmp.check_precon())
                    {
                        res.Add(new EventInstance(tmp.Clone(), group));
                    }
                }
            }
            return(res);
        }
 public EventInstance(BTEvent e, List <SmartObject> participants)
 {
     this.e            = e;
     this.participants = participants;
 }
 public void register_Event(BTEvent e)
 {
     events[e.Name] = e;
 }