Exemplo n.º 1
0
        public new object Clone()
        {
            CollidablePlayerObject player = new CollidablePlayerObject(ID, ActorType, StatusType, Transform3D.Clone() as Transform3D,
                                                                       EffectParameters.Clone() as EffectParameters, IVertexData.Clone() as IVertexData, CollisionPrimitive.Clone() as ICollisionPrimitive,
                                                                       ObjectManager, moveKeys, keyboardManager);

            player.ControllerList.AddRange(GetControllerListClone());
            return(player);
        }
        public new object Clone()
        {
            CollidableProjectile projectile = new CollidableProjectile(ID, ActorType, StatusType, Transform3D.Clone() as Transform3D,
                                                                       EffectParameters.Clone() as EffectParameters, IVertexData.Clone() as IVertexData, CollisionPrimitive.Clone() as ICollisionPrimitive,
                                                                       ObjectManager);

            projectile.ControllerList.AddRange(GetControllerListClone());
            return(projectile);
        }
        private void testCloning()
        {
            Transform3D t1
                = new Transform3D(Vector3.One,
                    Vector3.Zero,
                    Vector3.One, Vector3.UnitZ,
                    Vector3.UnitY);

            Transform3D clone
                    = (Transform3D)t1.Clone();

            clone.Translation = new Vector3(1, 2, 3);

            if (clone.Translation.Equals(t1.Translation))
                Console.WriteLine("same!");
            else
                Console.WriteLine("different!");

            Camera3D c1 = new Camera3D("1",
                ObjectType.FirstPersonCamera,
                t1,
                ProjectionParameters.StandardMediumFourThree,
                new Viewport(0,0,800,600));

            Camera3D cloneC1 = (Camera3D)c1.Clone();
            cloneC1.Viewport = new Viewport(0, 0, 10, 10);
        }