Ejemplo n.º 1
0
        public PSSGNodeInfo(EndianBinaryReader br)
        {
            AttributeInfo = new Dictionary <int, PSSGAttributeInfo>();
            int nameLength;

            ID         = br.ReadInt32();
            nameLength = br.ReadInt32();
            Name       = Encoding.ASCII.GetString(br.ReadBytes(nameLength));
            int attributeInfoCount = br.ReadInt32();

            for (int i = 0; i < attributeInfoCount; i++)
            {
                PSSGAttributeInfo ai = new PSSGAttributeInfo(br);
                AttributeInfo.Add(ai.ID, ai);
            }
        }
Ejemplo n.º 2
0
        protected override void OnOpen(EndianBinaryReader reader)
        {
            MagicNumber = Encoding.ASCII.GetString(reader.ReadBytes(4));

            reader.Endianness  = Endian.BigEndian;
            FileSize           = reader.ReadInt32();
            AttributeInfoCount = reader.ReadInt32();
            NodeInfoCount      = reader.ReadInt32();

            AttributeInfo = new PSSGAttributeInfo[AttributeInfoCount];
            NodeInfo      = new PSSGNodeInfo[NodeInfoCount];

            for (int i = 0; i < NodeInfoCount; i++)
            {
                NodeInfo[i] = new PSSGNodeInfo(reader);

                foreach (PSSGAttributeInfo ai in NodeInfo[i].AttributeInfo.Values)
                {
                    AttributeInfo[ai.ID - 1] = ai;
                }
            }

            RootNode = new PSSGNode(reader, this);
        }