示例#1
0
        internal BinTreeOptional(BinaryReader br, IBinTreeParent parent, uint nameHash) : base(parent, nameHash)
        {
            this.ValueType = BinUtilities.UnpackType((BinPropertyType)br.ReadByte());
            bool isSome = br.ReadBoolean();

            if (isSome)
            {
                this.Value = BinTreeProperty.Read(br, this, this.ValueType);
            }
        }
示例#2
0
        public BinTreeOptional(IBinTreeParent parent, uint nameHash, BinPropertyType type, BinTreeProperty value) : base(parent, nameHash)
        {
            this.ValueType = type;
            this.Value     = value;

            if (value is not null)
            {
                value.Parent = this;
            }
        }
示例#3
0
        internal static BinTreeProperty Read(BinaryReader br, IBinTreeParent parent, BinPropertyType?type = null)
        {
            uint            nameHash = 0;
            BinPropertyType packedType;

            if (type is null)
            {
                nameHash   = br.ReadUInt32();
                packedType = (BinPropertyType)br.ReadByte();
                type       = BinUtilities.UnpackType(packedType);
            }

            return(type switch
            {
                BinPropertyType.None => new BinTreeNone(br, parent, nameHash),
                BinPropertyType.Bool => new BinTreeBool(br, parent, nameHash),
                BinPropertyType.SByte => new BinTreeSByte(br, parent, nameHash),
                BinPropertyType.Byte => new BinTreeByte(br, parent, nameHash),
                BinPropertyType.Int16 => new BinTreeInt16(br, parent, nameHash),
                BinPropertyType.UInt16 => new BinTreeUInt16(br, parent, nameHash),
                BinPropertyType.Int32 => new BinTreeInt32(br, parent, nameHash),
                BinPropertyType.UInt32 => new BinTreeUInt32(br, parent, nameHash),
                BinPropertyType.Int64 => new BinTreeInt64(br, parent, nameHash),
                BinPropertyType.UInt64 => new BinTreeUInt64(br, parent, nameHash),
                BinPropertyType.Float => new BinTreeFloat(br, parent, nameHash),
                BinPropertyType.Vector2 => new BinTreeVector2(br, parent, nameHash),
                BinPropertyType.Vector3 => new BinTreeVector3(br, parent, nameHash),
                BinPropertyType.Vector4 => new BinTreeVector4(br, parent, nameHash),
                BinPropertyType.Matrix44 => new BinTreeMatrix44(br, parent, nameHash),
                BinPropertyType.Color => new BinTreeColor(br, parent, nameHash),
                BinPropertyType.String => new BinTreeString(br, parent, nameHash),
                BinPropertyType.Hash => new BinTreeHash(br, parent, nameHash),
                BinPropertyType.WadEntryLink => new BinTreeWadEntryLink(br, parent, nameHash),
                BinPropertyType.Container => new BinTreeContainer(br, parent, nameHash),
                BinPropertyType.UnorderedContainer => new BinTreeUnorderedContainer(br, parent, nameHash),
                BinPropertyType.Structure => new BinTreeStructure(br, parent, nameHash),
                BinPropertyType.Embedded => new BinTreeEmbedded(br, parent, nameHash),
                BinPropertyType.ObjectLink => new BinTreeObjectLink(br, parent, nameHash),
                BinPropertyType.Optional => new BinTreeOptional(br, parent, nameHash),
                BinPropertyType.Map => new BinTreeMap(br, parent, nameHash),
                BinPropertyType.BitBool => new BinTreeBitBool(br, parent, nameHash),
                _ => throw new InvalidOperationException("Invalid BinPropertyType: " + type),
            });
示例#4
0
 public BinTreeOptional(IBinTreeParent parent, uint nameHash, BinPropertyType type, BinTreeProperty value) : base(parent, nameHash)
 {
     this.ValueType = type;
     this.Value     = value;
 }
示例#5
0
 internal BinTreeUnorderedContainer(BinaryReader br, IBinTreeParent parent, uint nameHash) : base(br, parent, nameHash)
 {
 }
示例#6
0
 public BinTreeMatrix44(IBinTreeParent parent, uint nameHash, Matrix4x4 value) : base(parent, nameHash)
 {
     this.Value = value;
 }
示例#7
0
 public BinTreeByte(IBinTreeParent parent, uint nameHash, byte value) : base(parent, nameHash)
 {
     this.Value = value;
 }
示例#8
0
 public BinTreeVector4(IBinTreeParent parent, uint nameHash, Vector4 value) : base(parent, nameHash)
 {
     this.Value = value;
 }
示例#9
0
 public BinTreeNone(IBinTreeParent parent, uint nameHash) : base(parent, nameHash)
 {
 }
示例#10
0
 public BinTreeObjectLink(IBinTreeParent parent, uint nameHash, uint value) : base(parent, nameHash)
 {
     this.Value = value;
 }
示例#11
0
 internal BinTreeColor(BinaryReader br, IBinTreeParent parent, uint nameHash) : base(parent, nameHash)
 {
     this.Value = br.ReadColor(ColorFormat.RgbaU8);
 }
示例#12
0
 public BinTreeColor(IBinTreeParent parent, uint nameHash, Color value) : base(parent, nameHash)
 {
     this.Value = value;
 }
示例#13
0
 internal BinTreeFloat(BinaryReader br, IBinTreeParent parent, uint nameHash) : base(parent, nameHash)
 {
     this.Value = br.ReadSingle();
 }
示例#14
0
 public BinTreeFloat(IBinTreeParent parent, uint nameHash, float value) : base(parent, nameHash)
 {
     this.Value = value;
 }
示例#15
0
 protected BinTreeProperty(IBinTreeParent parent, uint nameHash)
 {
     this.Parent   = parent;
     this.NameHash = nameHash;
 }
示例#16
0
 internal BinTreeString(BinaryReader br, IBinTreeParent parent, uint nameHash) : base(parent, nameHash)
 {
     this.Value = Encoding.ASCII.GetString(br.ReadBytes(br.ReadUInt16()));
 }
示例#17
0
 internal BinTreeNone(BinaryReader br, IBinTreeParent parent, uint nameHash) : base(parent, nameHash)
 {
 }
示例#18
0
 internal BinTreeObjectLink(BinaryReader br, IBinTreeParent parent, uint nameHash) : base(parent, nameHash)
 {
     this.Value = br.ReadUInt32();
 }
示例#19
0
 public BinTreeUInt32(IBinTreeParent parent, uint nameHash, uint value) : base(parent, nameHash)
 {
     this.Value = value;
 }
 public BinTreeWadEntryLink(IBinTreeParent parent, uint nameHash, ulong value) : base(parent, nameHash)
 {
     this.Value = value;
 }
 internal BinTreeWadEntryLink(BinaryReader br, IBinTreeParent parent, uint nameHash) : base(parent, nameHash)
 {
     this.Value = br.ReadUInt64();
 }
示例#22
0
 public BinTreeInt16(IBinTreeParent parent, uint nameHash, short value) : base(parent, nameHash)
 {
     this.Value = value;
 }
示例#23
0
 internal BinTreeVector4(BinaryReader br, IBinTreeParent parent, uint nameHash) : base(parent, nameHash)
 {
     this.Value = br.ReadVector4();
 }
示例#24
0
 public BinTreeInt64(IBinTreeParent parent, uint nameHash, long value) : base(parent, nameHash)
 {
     this.Value = value;
 }
示例#25
0
 internal BinTreeByte(BinaryReader br, IBinTreeParent parent, uint nameHash) : base(parent, nameHash)
 {
     this.Value = br.ReadByte();
 }
示例#26
0
 public BinTreeBool(IBinTreeParent parent, uint nameHash, bool value) : base(parent, nameHash)
 {
     this.Value = value;
 }
示例#27
0
 internal BinTreeMatrix44(BinaryReader br, IBinTreeParent parent, uint nameHash) : base(parent, nameHash)
 {
     this.Value = br.ReadMatrix4x4RowMajor();
 }
示例#28
0
 public BinTreeString(IBinTreeParent parent, uint nameHash, string value) : base(parent, nameHash)
 {
     this.Value = value;
 }
示例#29
0
 public BinTreeUnorderedContainer(IBinTreeParent parent, uint nameHash, BinPropertyType propertiesType, IEnumerable <BinTreeProperty> properties)
     : base(parent, nameHash, propertiesType, properties)
 {
 }
示例#30
0
 public BinTreeEmbedded(IBinTreeParent parent, uint nameHash, uint metaClassHash, IEnumerable <BinTreeProperty> properties)
     : base(parent, nameHash, metaClassHash, properties)
 {
 }