예제 #1
0
        public bool Equals([AllowNull] Shape other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) &&
                   (Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) &&
                   (Layer == other.Layer && Layer != null && other.Layer != null && Layer.Equals(other.Layer)) &&
                   (XRef == other.XRef && XRef != null && other.XRef != null && XRef.Equals(other.XRef)) &&
                   (XSizeMode == other.XSizeMode && XSizeMode != null && other.XSizeMode != null && XSizeMode.Equals(other.XSizeMode)) &&
                   (XAnchor == other.XAnchor && XAnchor != null && other.XAnchor != null && XAnchor.Equals(other.XAnchor)) &&
                   (X0 == other.X0 && X0 != null && other.X0 != null && X0.Equals(other.X0)) &&
                   (X1 == other.X1 && X1 != null && other.X1 != null && X1.Equals(other.X1)) &&
                   (YRef == other.YRef && YRef != null && other.YRef != null && YRef.Equals(other.YRef)) &&
                   (YSizeMode == other.YSizeMode && YSizeMode != null && other.YSizeMode != null && YSizeMode.Equals(other.YSizeMode)) &&
                   (YAnchor == other.YAnchor && YAnchor != null && other.YAnchor != null && YAnchor.Equals(other.YAnchor)) &&
                   (Y0 == other.Y0 && Y0 != null && other.Y0 != null && Y0.Equals(other.Y0)) &&
                   (Y1 == other.Y1 && Y1 != null && other.Y1 != null && Y1.Equals(other.Y1)) &&
                   (Path == other.Path && Path != null && other.Path != null && Path.Equals(other.Path)) &&
                   (Opacity == other.Opacity && Opacity != null && other.Opacity != null && Opacity.Equals(other.Opacity)) &&
                   (Line == other.Line && Line != null && other.Line != null && Line.Equals(other.Line)) &&
                   (FillColor == other.FillColor && FillColor != null && other.FillColor != null && FillColor.Equals(other.FillColor)) &&
                   (FillRule == other.FillRule && FillRule != null && other.FillRule != null && FillRule.Equals(other.FillRule)) &&
                   (Editable == other.Editable && Editable != null && other.Editable != null && Editable.Equals(other.Editable)) &&
                   (Name == other.Name && Name != null && other.Name != null && Name.Equals(other.Name)) &&
                   (TemplateItemName == other.TemplateItemName && TemplateItemName != null && other.TemplateItemName != null && TemplateItemName.Equals(other.TemplateItemName)));
        }
예제 #2
0
        public bool Equals(Garage other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Type.Equals(other.Type) &&
                   State.Equals(other.State) &&
                   Field02h.Equals(other.Field02h) &&
                   ClosingWithoutTargetVehicle.Equals(other.ClosingWithoutTargetVehicle) &&
                   Deactivated.Equals(other.Deactivated) &&
                   ResprayHappened.Equals(other.ResprayHappened) &&
                   TargetModelIndex.Equals(other.TargetModelIndex) &&
                   Door1Pointer.Equals(other.Door1Pointer) &&
                   Door2Pointer.Equals(other.Door2Pointer) &&
                   Door1Handle.Equals(other.Door1Handle) &&
                   Door2Handle.Equals(other.Door2Handle) &&
                   IsDoor1Dummy.Equals(other.IsDoor1Dummy) &&
                   IsDoor2Dummy.Equals(other.IsDoor2Dummy) &&
                   RecreateDoorOnNextRefresh.Equals(other.RecreateDoorOnNextRefresh) &&
                   RotatingDoor.Equals(other.RotatingDoor) &&
                   CameraFollowsPlayer.Equals(other.CameraFollowsPlayer) &&
                   X1.Equals(other.X1) &&
                   X2.Equals(other.X2) &&
                   Y1.Equals(other.Y1) &&
                   Y2.Equals(other.Y2) &&
                   Z1.Equals(other.Z1) &&
                   Z2.Equals(other.Z2) &&
                   DoorOpenOffset.Equals(other.DoorOpenOffset) &&
                   DoorOpenMax.Equals(other.DoorOpenMax) &&
                   Door1X.Equals(other.Door1X) &&
                   Door1Y.Equals(other.Door1Y) &&
                   Door2X.Equals(other.Door2X) &&
                   Door2Y.Equals(other.Door2Y) &&
                   Door1Z.Equals(other.Door1Z) &&
                   Door2Z.Equals(other.Door2Z) &&
                   Timer.Equals(other.Timer) &&
                   CollectedCarsState.Equals(other.CollectedCarsState) &&
                   TargetCarPointer.Equals(other.TargetCarPointer) &&
                   Field96h.Equals(other.Field96h) &&
                   StoredCar.Equals(other.StoredCar));
        }
예제 #3
0
        public bool Equals(Garage other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Type.Equals(other.Type) &&
                   State.Equals(other.State) &&
                   MaxCarsAllowed.Equals(other.MaxCarsAllowed) &&
                   ClosingWithoutTargetVehicle.Equals(other.ClosingWithoutTargetVehicle) &&
                   Deactivated.Equals(other.Deactivated) &&
                   ResprayHappened.Equals(other.ResprayHappened) &&
                   Door1Pointer.Equals(other.Door1Pointer) &&
                   Door2Pointer.Equals(other.Door2Pointer) &&
                   Door1Handle.Equals(other.Door1Handle) &&
                   Door2Handle.Equals(other.Door2Handle) &&
                   IsDoor1Dummy.Equals(other.IsDoor1Dummy) &&
                   IsDoor2Dummy.Equals(other.IsDoor2Dummy) &&
                   RecreateDoorOnNextRefresh.Equals(other.RecreateDoorOnNextRefresh) &&
                   RotatingDoor.Equals(other.RotatingDoor) &&
                   CameraFollowsPlayer.Equals(other.CameraFollowsPlayer) &&
                   Position.Equals(other.Position) &&
                   Rotation.Equals(other.Rotation) &&
                   CeilingZ.Equals(other.CeilingZ) &&
                   DoorRelated1.Equals(other.DoorRelated1) &&
                   DoorRelated2.Equals(other.DoorRelated2) &&
                   X1.Equals(other.X1) &&
                   X2.Equals(other.X2) &&
                   Y1.Equals(other.Y1) &&
                   Y2.Equals(other.Y2) &&
                   DoorOpenOffset.Equals(other.DoorOpenOffset) &&
                   DoorOpenMax.Equals(other.DoorOpenMax) &&
                   Door1X.Equals(other.Door1X) &&
                   Door1Y.Equals(other.Door1Y) &&
                   Door2X.Equals(other.Door2X) &&
                   Door2Y.Equals(other.Door2Y) &&
                   Door1Z.Equals(other.Door1Z) &&
                   Door2Z.Equals(other.Door2Z) &&
                   Timer.Equals(other.Timer));
        }
예제 #4
0
        private void AddStrokeNumbers(Stroke stroke)
        {
            if (!ShowNumbersForStroke(stroke))
            {
                return;
            }

            FrameworkElement strokeNumber = StrokeElements[stroke].Find(s => (ElementType)s.Tag == ElementType.StrokeNumber);

            if (strokeNumber != null)
            {
                strokeNumber.Visibility = Visibility.Visible;
                return;
            }

            bool isNetOrOut = stroke.EnumCourse == Models.Util.Enums.Stroke.Course.NetOut;

            double X1, Y1;

            Grid gridOfStroke = GetGridForStroke(stroke);

            Shape shape = StrokeShapes[stroke].Find(s => (ShapeType)s.Tag == ShapeType.Arrowtip);

            if (shape == null)
            {
                Debug.WriteLine("Adding stroke number to stroke {0} of rally {1} failed - no arrow tip shape found.", stroke.Number, stroke.Rally.Number);
                return;
            }
            GetPointOfShapeRelativeToGrid(shape, PointType.Start, gridOfStroke, out X1, out Y1);

            if (X1.Equals(double.NaN) || Y1.Equals(double.NaN))
            {
                Debug.WriteLine("Adding stroke number to stroke {0} of rally {2} failed - arrow tip has NaN coordinates (x={3} y={4})", stroke.Number, stroke.Rally.Number, X1, Y1);
                return;
            }

            TextBlock textBlock = new TextBlock();

            textBlock.Text = stroke.Number.ToString();

            textBlock.Width  = 12;
            textBlock.Height = 17;
            textBlock.HorizontalAlignment = HorizontalAlignment.Left;
            textBlock.VerticalAlignment   = VerticalAlignment.Top;

            // arbitrary positioning relative to stroke arrow
            X1 = X1 + 10;
            Y1 = Y1 - 2;

            Thickness margin = new Thickness(
                Math.Min(X1, gridOfStroke.ActualWidth - textBlock.Width),
                Math.Min(Y1, gridOfStroke.ActualHeight - textBlock.Height),
                0,
                0);

            textBlock.Margin = margin;

            textBlock.FontWeight = FontWeights.Bold;
            textBlock.Foreground = isNetOrOut ? Brushes.DarkRed : Brushes.DarkOliveGreen;

            textBlock.Tag = ElementType.StrokeNumber;

            StrokeElements[stroke].Add(textBlock);

            gridOfStroke.Children.Add(textBlock);

            if (!ShowNumbers)
            {
                textBlock.Visibility = Visibility.Hidden;
            }
        }
예제 #5
0
 public bool Equals(Line other)
 {
     return(X1.Equals(other.X1) && X2.Equals(other.X2) && Y1.Equals(other.Y1) && Y2.Equals(other.Y2));
 }
예제 #6
0
 private bool Equals(Vec3 other)
 {
     return(X1.Equals(other.X1) && X2.Equals(other.X2) && X3.Equals(other.X3));
 }
예제 #7
0
        /// <summary>
        /// Returns true if BarcodeInfo instances are equal
        /// </summary>
        /// <param name="input">Instance of BarcodeInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BarcodeInfo input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Type == input.Type ||
                     Type.Equals(input.Type)
                     ) &&
                 (
                     Barcode1DSymbology == input.Barcode1DSymbology ||
                     Barcode1DSymbology.Equals(input.Barcode1DSymbology)
                 ) &&
                 (
                     Data == input.Data ||
                     (Data != null &&
                      Data.Equals(input.Data))
                 ) &&
                 (
                     X1 == input.X1 ||
                     X1.Equals(input.X1)
                 ) &&
                 (
                     X2 == input.X2 ||
                     X2.Equals(input.X2)
                 ) &&
                 (
                     X3 == input.X3 ||
                     X3.Equals(input.X3)
                 ) &&
                 (
                     X4 == input.X4 ||
                     X4.Equals(input.X4)
                 ) &&
                 (
                     Y1 == input.Y1 ||
                     Y1.Equals(input.Y1)
                 ) &&
                 (
                     Y2 == input.Y2 ||
                     Y2.Equals(input.Y2)
                 ) &&
                 (
                     Y3 == input.Y3 ||
                     Y3.Equals(input.Y3)
                 ) &&
                 (
                     Y4 == input.Y4 ||
                     Y4.Equals(input.Y4)
                 ) &&
                 (
                     BboxLeftInches == input.BboxLeftInches ||
                     BboxLeftInches.Equals(input.BboxLeftInches)
                 ) &&
                 (
                     BboxTopInches == input.BboxTopInches ||
                     BboxTopInches.Equals(input.BboxTopInches)
                 ) &&
                 (
                     BboxWidthInches == input.BboxWidthInches ||
                     BboxWidthInches.Equals(input.BboxWidthInches)
                 ) &&
                 (
                     BboxHeightInches == input.BboxHeightInches ||
                     BboxHeightInches.Equals(input.BboxHeightInches)
                 ) &&
                 (
                     PageNumber == input.PageNumber ||
                     PageNumber.Equals(input.PageNumber)
                 ) &&
                 (
                     PagePixelWidth == input.PagePixelWidth ||
                     PagePixelWidth.Equals(input.PagePixelWidth)
                 ) &&
                 (
                     PagePixelHeight == input.PagePixelHeight ||
                     PagePixelHeight.Equals(input.PagePixelHeight)
                 ) &&
                 (
                     PageHorizontalResolution == input.PageHorizontalResolution ||
                     PageHorizontalResolution.Equals(input.PageHorizontalResolution)
                 ) &&
                 (
                     PageVerticalResolution == input.PageVerticalResolution ||
                     PageVerticalResolution.Equals(input.PageVerticalResolution)
                 ));
        }