コード例 #1
0
        public void AddDanger(ISensorableObject obj, float distance)
        {
            var type = obj.ObjType;

            this.currentDangerObjects[type].Add(new SensorObject()
            {
                obj = obj, distance = distance
            });
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 public float GetDistance(ISensorableObject other)
 {
     return(math.distance(this.Position, other.Position));
 }