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); }
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); }
protected PrimitiveObject GetPrimitiveObjectFromVertexData(IVertexData vertexData, ShapeType shapeType, EffectParameters effectParameters) { //instanicate the object PrimitiveObject primitiveObject = new PrimitiveObject("Archetype - " + shapeType.ToString(), ActorType.NotYetAssigned, Transform3D.Zero, effectParameters.Clone() as EffectParameters, StatusType.Update | StatusType.Drawn, vertexData); //add to the dictionary for re-use in any subsequent call to this method primitiveDictionary.Add(shapeType, primitiveObject); //return a reference to a CLONE of our original object - remember we always clone the dictionary object, rather than modify the archetype in the dictionary return(primitiveObject.Clone() as PrimitiveObject); }