Example #1
0
 private void sightingFound(RobotInterest target)
 {
     if (externalMentalModel != null) {
         externalMentalModel.addSighting(target);
     }
     mentalModel.addSighting (target);
 }
Example #2
0
 public void addSighting(RobotInterest target)
 {
     if (targetSightings.ContainsKey (target)) {
         if (targetSightings[target] == 0) {
             notifyListenersTargetFound(target);
         }
         targetSightings [target]++;
     } else {
         notifyListenersTargetFound(target);
         targetSightings[target] = 1;
     }
 }
Example #3
0
    public void removeSighting(RobotInterest target)
    {
        if (targetSightings.ContainsKey (target)) {
            targetSightings [target]--;
            if (targetSightings [target] < 1) {
                notifyListenersTargetLost (target);
            }
        } else {
            targetSightings[target] = 0;
            notifyListenersTargetLost (target);

        }
    }
Example #4
0
	public EventMessage(string type, RobotInterest target) {
		this.type = type;
		this.targetInfo = target;
	}
Example #5
0
 public void notifyListenersTargetLost(RobotInterest target)
 {
     for (int i = 0; i < listeners.Count; i++) {
         listeners[i].notifySightingLost(target);
     }
 }
Example #6
0
 public bool canSee(RobotInterest target)
 {
     return targetSightings.ContainsKey(target) && targetSightings[target] > 0;
 }
Example #7
0
	public RobotMessage(string src, string type, RobotInterest target) {
		this.source = src;
		this.type = type;
		this.target = target;
	}
Example #8
0
 private void sightingLost(RobotInterest target)
 {
     if (externalMentalModel != null) {
         externalMentalModel.removeSighting(target);
     }
     mentalModel.removeSighting (target);
 }
Example #9
0
 public void setTarget(RobotInterest target)
 {
     this.target = target;
 }
	public void notifySightingLost(RobotInterest target) {
		broadcastMessage (new EventMessage ("target lost", target));
	}
	public void notifySighting(RobotInterest target) {
		broadcastMessage (new EventMessage ("target found", target));
	}