Exemplo n.º 1
0
 public Water()
 {
     EditorID      = new SimpleSubrecord <String>("EDID");
     NoiseMap      = new SimpleSubrecord <String>("NNAM");
     Opacity       = new SimpleSubrecord <Byte>("ANAM");
     WaterFlags    = new SimpleSubrecord <WaterFlags>("FNAM");
     MaterialID    = new SimpleSubrecord <String>("MNAM");
     Damage        = new SimpleSubrecord <UInt16>("DATA");
     Data          = new WaterData("DNAM");
     RelatedWaters = new RelatedWaters("GNAM");
 }
Exemplo n.º 2
0
 public Water(SimpleSubrecord <String> EditorID, SimpleSubrecord <String> Name, SimpleSubrecord <String> NoiseMap, SimpleSubrecord <Byte> Opacity, SimpleSubrecord <WaterFlags> WaterFlags, SimpleSubrecord <String> MaterialID, RecordReference Sound, RecordReference ActorEffect, SimpleSubrecord <UInt16> Damage, WaterData Data, RelatedWaters RelatedWaters)
 {
     this.EditorID      = EditorID;
     this.NoiseMap      = NoiseMap;
     this.Opacity       = Opacity;
     this.WaterFlags    = WaterFlags;
     this.MaterialID    = MaterialID;
     this.Damage        = Damage;
     this.Data          = Data;
     this.RelatedWaters = RelatedWaters;
 }
Exemplo n.º 3
0
        public override void ReadData(ESPReader reader, long dataEnd)
        {
            while (reader.BaseStream.Position < dataEnd)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "EDID":
                    if (EditorID == null)
                    {
                        EditorID = new SimpleSubrecord <String>();
                    }

                    EditorID.ReadBinary(reader);
                    break;

                case "FULL":
                    if (Name == null)
                    {
                        Name = new SimpleSubrecord <String>();
                    }

                    Name.ReadBinary(reader);
                    break;

                case "NNAM":
                    if (NoiseMap == null)
                    {
                        NoiseMap = new SimpleSubrecord <String>();
                    }

                    NoiseMap.ReadBinary(reader);
                    break;

                case "ANAM":
                    if (Opacity == null)
                    {
                        Opacity = new SimpleSubrecord <Byte>();
                    }

                    Opacity.ReadBinary(reader);
                    break;

                case "FNAM":
                    if (WaterFlags == null)
                    {
                        WaterFlags = new SimpleSubrecord <WaterFlags>();
                    }

                    WaterFlags.ReadBinary(reader);
                    break;

                case "MNAM":
                    if (MaterialID == null)
                    {
                        MaterialID = new SimpleSubrecord <String>();
                    }

                    MaterialID.ReadBinary(reader);
                    break;

                case "SNAM":
                    if (Sound == null)
                    {
                        Sound = new RecordReference();
                    }

                    Sound.ReadBinary(reader);
                    break;

                case "XNAM":
                    if (ActorEffect == null)
                    {
                        ActorEffect = new RecordReference();
                    }

                    ActorEffect.ReadBinary(reader);
                    break;

                case "DATA":
                    ReadDamage(reader);
                    break;

                case "DNAM":
                    if (Data == null)
                    {
                        Data = new WaterData();
                    }

                    Data.ReadBinary(reader);
                    break;

                case "GNAM":
                    if (RelatedWaters == null)
                    {
                        RelatedWaters = new RelatedWaters();
                    }

                    RelatedWaters.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
Exemplo n.º 4
0
        public override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("EditorID", false, out subEle))
            {
                if (EditorID == null)
                {
                    EditorID = new SimpleSubrecord <String>();
                }

                EditorID.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

                Name.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("NoiseMap", false, out subEle))
            {
                if (NoiseMap == null)
                {
                    NoiseMap = new SimpleSubrecord <String>();
                }

                NoiseMap.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Opacity", false, out subEle))
            {
                if (Opacity == null)
                {
                    Opacity = new SimpleSubrecord <Byte>();
                }

                Opacity.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("WaterFlags", false, out subEle))
            {
                if (WaterFlags == null)
                {
                    WaterFlags = new SimpleSubrecord <WaterFlags>();
                }

                WaterFlags.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("MaterialID", false, out subEle))
            {
                if (MaterialID == null)
                {
                    MaterialID = new SimpleSubrecord <String>();
                }

                MaterialID.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Sound", false, out subEle))
            {
                if (Sound == null)
                {
                    Sound = new RecordReference();
                }

                Sound.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ActorEffect", false, out subEle))
            {
                if (ActorEffect == null)
                {
                    ActorEffect = new RecordReference();
                }

                ActorEffect.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Damage", false, out subEle))
            {
                if (Damage == null)
                {
                    Damage = new SimpleSubrecord <UInt16>();
                }

                Damage.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Data", false, out subEle))
            {
                if (Data == null)
                {
                    Data = new WaterData();
                }

                Data.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("RelatedWaters", false, out subEle))
            {
                if (RelatedWaters == null)
                {
                    RelatedWaters = new RelatedWaters();
                }

                RelatedWaters.ReadXML(subEle, master);
            }
        }