/// <summary> /// Initializes a new instance of the PCameraList class that contains cameras copied /// from the specified list and that has the same initial capacity as the number /// of cameras copied. /// </summary> /// <param name="list">The list whose cameras are copied to the new list.</param> public PCameraList(PCameraList list) { foreach (PCamera camera in list) { List.Add(camera); } }
/// <summary> /// Constructs a new PLayer. /// </summary> public PLayer() { cameras = new PCameraList(); }
//**************************************************************** // Serialization - Layers conditionally serialize their cameras. // This means that only the camera references that were unconditionally // (using GetObjectData) serialized by someone else will be restored // when the layer is unserialized. //**************************************************************** /// <summary> /// Read this this layer and all its children from the given SerializationInfo. /// </summary> /// <param name="info">The SerializationInfo to read from.</param> /// <param name="context"> /// The StreamingContext of this serialization operation. /// </param> /// <remarks> /// This constructor is required for Deserialization. /// </remarks> protected PLayer(SerializationInfo info, StreamingContext context) : base(info, context) { cameras = new PCameraList(); int count = info.GetInt32("cameraCount"); for (int i = 0; i < count; i++) { PCamera camera = (PCamera)info.GetValue("camera" + i, typeof(PCamera)); if (camera != null) { cameras.Add(camera); } } }
/// <summary> /// Adds the cameras of the given list to the end of this list. /// </summary> /// <param name="list"> /// The list whose cameras should be added to the end of this list. /// </param> public void AddRange(PCameraList list) { InnerList.AddRange(list); }
/// <summary> /// Initializes a new instance of the PCameraList class that contains cameras copied /// from the specified list and that has the same initial capacity as the number /// of cameras copied. /// </summary> /// <param name="list">The list whose cameras are copied to the new list.</param> public PCameraList(PCameraList list) { foreach(PCamera camera in list) { List.Add(camera); } }