public void AddBeacon(ScannerBeacon beacon) { if (Becons.Contains(beacon)) { throw new Exception("Becon added twice."); } if (Scaners.Contains(beacon.Scanner)) { throw new Exception("Scanner added twice."); } Becons.Add(beacon); Scaners.Add(beacon.Scanner); }
public long GetDistance(ScannerBeacon other) { var sum = Math.Pow(X - other.X, 2) + Math.Pow(Y - other.Y, 2) + Math.Pow(Z - other.Z, 2); return((long)Math.Sqrt(sum)); }