コード例 #1
0
    public override void Initialize(BinaryReader reader, RecordHeader header)
    {
        while (reader.BaseStream.Position < header.DataEndPos)
        {
            var type = (SubRecordType)reader.ReadInt32();
            var size = reader.ReadInt32();

            switch (type)
            {
            case SubRecordType.Id:
                name = reader.ReadString(size);
                break;

            case SubRecordType.Model:
                model = reader.ReadString(size);
                break;

            case SubRecordType.Name:
                fullName = reader.ReadString(size);
                break;

            case SubRecordType.Script:
                script = Script.Get(reader.ReadString(size));
                break;

            case SubRecordType.ContainerData:
                data = new ContainerRecordData(reader);
                break;

            case SubRecordType.Flag:
                flags = (ContainerFlags)reader.ReadInt32();
                break;

            case SubRecordType.InventoryItem:
                items.Add(new InventoryItem(reader));
                break;
            }
        }
    }
コード例 #2
0
 public ContainerData(ContainerFlags Flags, Single Weight)
 {
     this.Flags  = Flags;
     this.Weight = Weight;
 }
コード例 #3
0
 public ContainerData(string Tag = null)
     : base(Tag)
 {
     Flags  = new ContainerFlags();
     Weight = new Single();
 }