Esempio n. 1
0
        void MovePathAction_SingleActionCompleted(object sender, UnaryValueEvent<XmasAction> evt)
        {
            MoveAction mv = (MoveAction)evt.Value;

            if (mv.ActionFailed || mv.MoveStopped)
                this.StopMultiAction();
        }
        private void foreignTriggermanager_EventRaised(object sender, UnaryValueEvent<XmasEvent> evt)
        {
            EventHandler buffer = EventRecieved;
            this.queue.Enqueue(evt.Value);

            if (buffer != null)
                buffer(this, new EventArgs());
        }
Esempio n. 3
0
        void MovePathAction_SingleActionCompleted(object sender, UnaryValueEvent <XmasAction> evt)
        {
            MoveAction mv = (MoveAction)evt.Value;

            if (mv.ActionFailed || mv.MoveStopped)
            {
                this.StopMultiAction();
            }
        }
Esempio n. 4
0
 private void EISAgentController_PerceptsRecieved(object sender, UnaryValueEvent<PerceptCollection> evt)
 {
     IilPerceptCollection perceptcollection = (IilPerceptCollection) tool.ConvertToForeign(evt.Value);
     serializer.Serialize(swriter, perceptcollection);
     swriter.Flush();
     string description = String.Format("cycle completed");
     sw.Stop();
     TimeSpan elapsed = sw.Elapsed;
     //actman.Queue(new SimpleAction(sa => sa.EventManager.Raise(new EisAgentTimingEvent(Agent, description, elapsed))));
     sw.Reset();
     sw.Start();
 }
        //this method will be called when an agent recieves a percept
        private void agent_perceptRecieved(object sender, UnaryValueEvent<PerceptCollection> evt)
        {
            //go through all percepts
            foreach (Percept percept in evt.Value.Percepts)
            {

                if (percept is VacuumVision)
                {
                    //Check if the vacuum cleaner is in a tile with dirt then call suck
                    //otherwise move the vacuum cleaner
                    VacuumVision vision = percept as VacuumVision;

                    if (vision.ContainsDirt)
                        this.nextAction = new SuckAction();
                    else
                        this.nextAction = new MoveVacuumCleanerAction();
                }
            }
        }
Esempio n. 6
0
 private void trigger_RegisteredEvent(object sender, UnaryValueEvent<Type> evt)
 {
     triggers.Add(evt.Value, (Trigger) sender);
 }
Esempio n. 7
0
 private void actman_ActionQueuing(object sender, UnaryValueEvent<XmasAction> evt)
 {
     evt.Value.EventManager = EventManager;
     evt.Value.Factory = Factory;
     evt.Value.World = World;
     evt.Value.ActionManager = ActionManager;
 }
Esempio n. 8
0
 private void actman_ActionQueued(object sender, UnaryValueEvent<XmasAction> evt)
 {
     this.actionRecieved.Set();
 }