示例#1
0
 /// <summary>
 /// Initialize a new <see cref="RwTextureDictionaryNode"/> instance with an <see cref="IList{T}"/> of texture nodes.
 /// </summary>
 /// <param name="textures"><see cref="IList{T}"/>containing texture nodes to initialize the dictionary with.</param>
 public RwTextureDictionaryNode(IList <RwTextureNativeNode> textures)
     : base(RwNodeId.RwTextureDictionaryNode)
 {
     Textures       = textures.ToList();
     mExtensionNode = new RwExtensionNode(this);
     mStructNode    = new RwTextureDictionaryStructNode(this);
 }
示例#2
0
 /// <summary>
 /// Initialize a new empty <see cref="RwTextureDictionaryNode"/> instance.
 /// </summary>
 public RwTextureDictionaryNode()
     : base(RwNodeId.RwTextureDictionaryNode)
 {
     mStructNode    = new RwTextureDictionaryStructNode(this);
     mTextures      = new List <RwTextureNativeNode>();
     mExtensionNode = new RwExtensionNode(this);
 }
示例#3
0
        /// <summary>
        /// Constructor only to be called in <see cref="RwNodeFactory.GetNode(RwNode, BinaryReader)"/>.
        /// </summary>
        internal RwTextureDictionaryNode(RwNodeFactory.RwNodeHeader header, BinaryReader reader)
            : base(header)
        {
            mStructNode = RwNodeFactory.GetNode <RwTextureDictionaryStructNode>(this, reader);
            mTextures   = new List <RwTextureNativeNode>(mStructNode.TextureCount);

            for (int i = 0; i < mStructNode.TextureCount; i++)
            {
                mTextures.Add(RwNodeFactory.GetNode <RwTextureNativeNode>(this, reader));
            }

            mExtensionNode = RwNodeFactory.GetNode <RwExtensionNode>(this, reader);
        }
示例#4
0
        public RwTextureDictionaryNode(Stream stream, bool leaveOpen)
            : base(RwNodeId.RwTextureDictionaryNode)
        {
            var node = Load(stream, leaveOpen) as RwTextureDictionaryNode;

            if (node == null)
            {
                throw new System.Exception();
            }

            mStructNode    = node.mStructNode;
            mTextures      = node.mTextures;
            mExtensionNode = node.mExtensionNode;
        }