예제 #1
0
 public LocationSource(String name, Discriminator discrimintor)
 {
     this.Id = System.Guid.NewGuid();
     this.Name = name;
     this.Discri = discrimintor;
     this.mapMarker = new LocationSourceMapMarker(this);
 }
 public override bool IsSimilar(Discriminator other)
 {
     if (other is ColorDiscriminator)
     {
         ColorDiscriminator otherColorDiscriminator = (ColorDiscriminator)other;
         int diff = otherColorDiscriminator.color.Hue - this.color.Hue;
         if (diff < 0)
             diff = -diff;
         if (diff < this.threshold)
             return true;
         else
             return false;
     }
     else
     {
         return false;
     }
 }
예제 #3
0
 override public bool IsSimilar(Discriminator other)
 {
     if (other is ColorDiscriminator)
     {
         ColorDiscriminator otherColorDiscriminator = (ColorDiscriminator)other;
         int diff = otherColorDiscriminator.color.Hue - this.color.Hue;
         if (diff < 0)
         {
             diff = -diff;
         }
         if (diff < this.threshold)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
예제 #4
0
 public override bool IsSimilar(Discriminator other)
 {
     return(false);
 }
예제 #5
0
 public abstract bool IsSimilar(Discriminator other);
예제 #6
0
 public abstract bool IsSimilar(Discriminator other);
 public override bool IsSimilar(Discriminator other)
 {
     return false;
 }
 public LocationSource createLocationSource(string name, Discriminator discriminator)
 {
     LocationSource user = new LocationSource(name, discriminator);
     this.LocationSources.Add(user);
     return user;
 }
 public void updateLocationSource(Discriminator discriminator, IntPoint screenPos)
 {
     if (locationSources.Count == 0)
         return;
     lock (this.locationSources)
     {
         for (int i = 0; i < locationSources.Count; i++)
         {
             if (locationSources[i].Discri.IsSimilar(discriminator))
             {
                 locationSources[i].ScreenPos = screenPos;
                 locationSources[i].LatLng = MapOverlayForm.Instance.FromLocalToLatLng(screenPos.X, screenPos.Y);
             }
         }
     }
 }