public new object Clone()
 {
     return(new UITextObject("clone - " + ID, ActorType, StatusType,
                             Transform2D.Clone() as Transform2D,
                             Color,
                             LayerDepth,
                             SpriteEffects,
                             text,
                             spriteFont //shallow - reference
                             ));
 }
        public void CloneTest()
        {
            Transform2D original = new Transform2D(new Vector2(10, 10), 45, Vector2.One, Vector2.Zero, new Integer2(10, 20));
            Transform2D clone    = (Transform2D)original.Clone();

            Assert.AreEqual(original, clone);

            //change clone and should be distince from original because its a deep copy
            clone.Translation = new Vector2(100, 300);
            Assert.AreNotEqual(original, clone);
        }
        public new object Clone()
        {
            Actor2D clonedActor = new DrawnActor2D("clone - " + ID, ActorType, StatusType,
                                                   Transform2D.Clone() as Transform2D, //shallow if we write this.Transform2D but deep with Clone()
                                                   color,
                                                   layerDepth,
                                                   spriteEffects); //deep

            clonedActor.ControllerList.AddRange(GetControllerListClone());
            return(clonedActor);
        }
Exemple #4
0
 public new object Clone()
 {
     return(new UIButtonObject("clone - " + ID, ActorType, StatusType,
                               Transform2D.Clone() as Transform2D,
                               Color, LayerDepth, SpriteEffects,
                               Texture, //shallow - reference
                               SourceRectangle,
                               text,
                               spriteFont,              //shallow - reference
                               textScale,
                               textColor, textOffset)); //hybrid
 }
        public new object Clone()
        {
            UIButtonObject uiButtonObject = new UIButtonObject("clone - " + ID, ActorType, StatusType,
                                                               Transform2D.Clone() as Transform2D, Color, LayerDepth, SpriteEffects,
                                                               Texture, //shallow - reference
                                                               SourceRectangle,
                                                               text,
                                                               spriteFont, //shallow - reference
                                                               this.TextScale,
                                                               textColor, textOffset);

            uiButtonObject.ControllerList.AddRange(GetControllerListClone());
            return(uiButtonObject);
        }
        internal SLShapeProperties Clone()
        {
            var sp = new SLShapeProperties(listThemeColors);

            sp.HasBlackWhiteMode = HasBlackWhiteMode;
            sp.vBlackWhiteMode   = vBlackWhiteMode;
            sp.HasTransform2D    = HasTransform2D;
            sp.Transform2D       = Transform2D.Clone();
            sp.HasPresetGeometry = HasPresetGeometry;
            sp.vPresetGeometry   = vPresetGeometry;
            sp.Fill       = Fill.Clone();
            sp.Outline    = Outline.Clone();
            sp.EffectList = EffectList.Clone();
            sp.Rotation3D = Rotation3D.Clone();
            sp.Format3D   = Format3D.Clone();

            return(sp);
        }
        public void ResetTest()
        {
            //original and a copy for comparison after reset
            Transform2D original = new Transform2D(new Vector2(10, 10), 45, Vector2.One, Vector2.Zero, new Integer2(10, 20));
            Transform2D clone    = (Transform2D)original.Clone();

            //change somethings in the original

            original.Translation       = Vector2.Zero;
            original.RotationInDegrees = 45;
            original.Scale             = new Vector2(45, 55);
            original.Origin            = new Vector2(-10, 10);

            //reset the original
            original.Reset();

            //ensure its been reset
            Assert.AreEqual(original, clone);
        }
Exemple #8
0
 public new object Clone()
 {
     return(new DrawnActor2D("clone - " + ID, ActorType, StatusType, Transform2D.Clone() as Transform2D,
                             color, layerDepth, spriteEffects));
 }