private void sightingFound(RobotInterest target) { if (externalMentalModel != null) { externalMentalModel.addSighting(target); } mentalModel.addSighting (target); }
public void addSighting(RobotInterest target) { if (targetSightings.ContainsKey (target)) { if (targetSightings[target] == 0) { notifyListenersTargetFound(target); } targetSightings [target]++; } else { notifyListenersTargetFound(target); targetSightings[target] = 1; } }
public void removeSighting(RobotInterest target) { if (targetSightings.ContainsKey (target)) { targetSightings [target]--; if (targetSightings [target] < 1) { notifyListenersTargetLost (target); } } else { targetSightings[target] = 0; notifyListenersTargetLost (target); } }
public EventMessage(string type, RobotInterest target) { this.type = type; this.targetInfo = target; }
public void notifyListenersTargetLost(RobotInterest target) { for (int i = 0; i < listeners.Count; i++) { listeners[i].notifySightingLost(target); } }
public bool canSee(RobotInterest target) { return targetSightings.ContainsKey(target) && targetSightings[target] > 0; }
public RobotMessage(string src, string type, RobotInterest target) { this.source = src; this.type = type; this.target = target; }
private void sightingLost(RobotInterest target) { if (externalMentalModel != null) { externalMentalModel.removeSighting(target); } mentalModel.removeSighting (target); }
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)); }