Example #1
0
 private void SetPosture(CogbotEvent evt)
 {
     lock (postureLock)
     {
         if (PostureType != null)
         {
             // was the same 
             if (PostureType == evt.Verb) return;
             CogbotEvent ending = new ACogbotEvent(evt.Sender,
                 SimEventType.Stop | SimEventType.ANIM | SimEventType.REGIONAL,
                 PostureType + (IsFlying ? "-Flying" : ""),
                 evt.Parameters) { Serial = LastPostureEvent.Serial };
             LogEvent(ending);
             PostureType = evt.Verb;
             CogbotEvent starting = new ACogbotEvent(evt.Sender,
                                         SimEventType.Start | SimEventType.ANIM | SimEventType.REGIONAL,
                 PostureType + (IsFlying ? "-Flying" : ""),
                 evt.Parameters) { Serial = evt.Serial };
             LogEvent(starting);
         }
         PostureType = evt.Verb;
         LastPostureEvent = evt;
     }
 }
 private KeyValuePair<object, CogbotEvent> taskFromCodeTree(object lispObject)
 {
     CogbotEvent evt = new ACogbotEvent(taskInterperter, SimEventType.SCRIPT | SimEventType.PERSONAL, "enqueue", new[] { lispObject });
     return new KeyValuePair<object, CogbotEvent>(lispObject, evt);
 }