public void AddDanger(ISensorableObject obj, float distance) { var type = obj.ObjType; this.currentDangerObjects[type].Add(new SensorObject() { obj = obj, distance = distance }); }
public void SetClosest(ISensorableObject obj, float distance) { var type = obj.ObjType; var newObj = new SensorObject() { obj = obj, distance = distance }; if (this.closestObjects.ContainsKey(type)) { this.closestObjects[type] = newObj; } else { this.closestObjects.Add(type, newObj); } }
public float GetDistance(ISensorableObject other) { return(math.distance(this.Position, other.Position)); }