Пример #1
0
 public WeatherChance(WeatherChance copyObject)
 {
     if (copyObject.Weather != null)
     {
         Weather = (FormID)copyObject.Weather.Clone();
     }
     Chance = copyObject.Chance;
     if (copyObject.Global != null)
     {
         Global = (FormID)copyObject.Global.Clone();
     }
 }
Пример #2
0
 public RegionObject(FormID Object, UInt16 ParentIndex, Byte[] Unused, Single Density, Byte Clustering, Byte MinSlope, Byte MaxSlope, RegionObjectFlags Flags, UInt16 RadiusWithRespectToParent, UInt16 Radius, Byte[] Unknown1, Single MaxHeight, Single Sink, Single SinkVariance, Single SizeVariance, UInt16 XAngleVariance, UInt16 YAngleVariance, UInt16 ZAngleVariance, Byte[] Unknown2)
 {
     this.Object      = Object;
     this.ParentIndex = ParentIndex;
     this.Unused      = Unused;
     this.Density     = Density;
     this.Clustering  = Clustering;
     this.MinSlope    = MinSlope;
     this.MaxSlope    = MaxSlope;
     this.Flags       = Flags;
     this.RadiusWithRespectToParent = RadiusWithRespectToParent;
     this.Radius         = Radius;
     this.Unknown1       = Unknown1;
     this.MaxHeight      = MaxHeight;
     this.Sink           = Sink;
     this.SinkVariance   = SinkVariance;
     this.SizeVariance   = SizeVariance;
     this.XAngleVariance = XAngleVariance;
     this.YAngleVariance = YAngleVariance;
     this.ZAngleVariance = ZAngleVariance;
     this.Unknown2       = Unknown2;
 }
Пример #3
0
 public RegionObject()
 {
     Object      = new FormID();
     ParentIndex = new UInt16();
     Unused      = new byte[2];
     Density     = new Single();
     Clustering  = new Byte();
     MinSlope    = new Byte();
     MaxSlope    = new Byte();
     Flags       = new RegionObjectFlags();
     RadiusWithRespectToParent = new UInt16();
     Radius         = new UInt16();
     Unknown1       = new byte[4];
     MaxHeight      = new Single();
     Sink           = new Single();
     SinkVariance   = new Single();
     SizeVariance   = new Single();
     XAngleVariance = new UInt16();
     YAngleVariance = new UInt16();
     ZAngleVariance = new UInt16();
     Unknown2       = new byte[6];
 }
Пример #4
0
        public LoadOrderFormID(FormID fileFormID, ElderScrollsPlugin file)
        {
            uint fileIndex   = fileFormID.RawValue >> 24;
            uint recordIndex = fileFormID.RawValue & 0x00FFFFFF;

            if (fileIndex >= file.Masters.Count)
            {
                fileIndex = (uint)(file.Masters.Count - 1);
            }

            string             masterName = file.Masters[(int)fileIndex];
            ElderScrollsPlugin master     = ElderScrollsPlugin.LoadedPlugins.FirstOrDefault(esp => esp.FileName == masterName);

            if (master == null)
            {
                throw new Exception();
            }

            Master = master;

            uint newFileIndex = (uint)(ElderScrollsPlugin.LoadedPlugins.IndexOf(master) << 24);

            RawValue = newFileIndex | recordIndex;
        }
Пример #5
0
 public WeatherChance()
 {
     Weather = new FormID();
     Chance  = new Int32();
     Global  = new FormID();
 }
Пример #6
0
 public Comparison(ConditionFlags Flags, ConditionComparisonType Operator, byte[] Unused, FormID ComparisonValue)
 {
     this.Flags           = Flags;
     this.Operator        = Operator;
     this.Unused          = Unused;
     this.ComparisonValue = ComparisonValue.Clone();
 }
Пример #7
0
 public AlternateTexture(String Name, FormID TextureSet, Int32 Index)
 {
     this.Name       = Name;
     this.TextureSet = TextureSet;
     this.Index      = Index;
 }
Пример #8
0
        public void ReadXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("Type", false, out subEle))
            {
                Type = subEle.ToEnum <FunctionType>();
            }

            TypeStringArgData data;

            if (Metadata.TryGetValue(Type, out data))
            {
                Arg1Label = data.Arg1Label;
                Arg2Label = data.Arg2Label;
                Arg1Type  = data.Arg1Type;
                Arg2Type  = data.Arg2Type;

                if (ele.TryPathTo(Arg1Label, false, out subEle))
                {
                    if (Arg1Type == null)
                    {
                        Argument1 = subEle.ToBytes();
                    }
                    else if (Arg1Type == typeof(FormID))
                    {
                        Argument1 = new FormID();
                        Argument1.ReadXML(subEle, master);
                    }
                    else if (Arg1Type == typeof(VATSValue))
                    {
                        Argument1 = subEle.ToEnum <VATSValue>();

                        TypeStringArgData tempData;

                        if (VATSMetadata.TryGetValue(Argument1, out tempData))
                        {
                            Arg2Type  = tempData.Arg1Type;
                            Arg2Label = tempData.Arg1Label;
                        }
                        else
                        {
                            throw new ArgumentException("VATSValue " + Argument1.ToString() + " is not handled.");
                        }
                    }
                    else if (Arg1Type.IsEnum)
                    {
                        Argument1 = Enum.Parse(Arg1Type, subEle.Value);
                    }
                    else
                    {
                        throw new ArgumentException(Arg1Type.ToString() + " is not handled.");
                    }
                }

                if (ele.TryPathTo(Arg2Label, false, out subEle))
                {
                    if (Arg2Type == null)
                    {
                        Argument2 = subEle.ToBytes();
                    }
                    else if (Arg2Type == typeof(FormID))
                    {
                        Argument2 = new FormID();
                        Argument2.ReadXML(subEle, master);
                    }
                    else if (Arg2Type.IsEnum)
                    {
                        Argument2 = Enum.Parse(Arg2Type, subEle.Value);
                    }
                    else if (Arg2Type == typeof(uint))
                    {
                        Argument2 = subEle.ToUInt32();
                    }
                    else
                    {
                        throw new ArgumentException(Arg2Type.ToString() + " is not handled.");
                    }
                }
            }
            else
            {
                throw new Exception(Type.ToString() + " was not in the dictionary.");
            }
        }
Пример #9
0
 public RegionSound()
 {
     Sound  = new FormID();
     Flags  = new RegionSoundFlags();
     Chance = new UInt32();
 }
Пример #10
0
 public NavMeshExternalConnection()
 {
     Unknown        = new byte[4];
     NavigationMesh = new FormID();
     Triangle       = new UInt16();
 }
Пример #11
0
 public RegionGrass(FormID Form, Byte[] Unknown)
 {
     this.Form    = Form;
     this.Unknown = Unknown;
 }
Пример #12
0
 public RegionGrass()
 {
     Form    = new FormID();
     Unknown = new byte[4];
 }
Пример #13
0
 public NavMeshDoor(FormID Door, UInt16 Triangle, Byte[] Unused)
 {
     this.Door     = Door;
     this.Triangle = Triangle;
     this.Unused   = Unused;
 }
Пример #14
0
 public NavMeshDoor()
 {
     Door     = new FormID();
     Triangle = new UInt16();
     Unused   = new byte[2];
 }
Пример #15
0
 public WeatherChance(FormID Weather, Int32 Chance, FormID Global)
 {
     this.Weather = Weather;
     this.Chance  = Chance;
     this.Global  = Global;
 }
Пример #16
0
 public NavMeshExternalConnection(Byte[] Unknown, FormID NavigationMesh, UInt16 Triangle)
 {
     this.Unknown        = Unknown;
     this.NavigationMesh = NavigationMesh;
     this.Triangle       = Triangle;
 }
Пример #17
0
 public AlternateTexture()
 {
     Name       = "";
     TextureSet = new FormID();
     Index      = new Int32();
 }
Пример #18
0
 public RegionSound(FormID Sound, RegionSoundFlags Flags, UInt32 Chance)
 {
     this.Sound  = Sound;
     this.Flags  = Flags;
     this.Chance = Chance;
 }
Пример #19
0
        public void ReadBinary(ESPReader reader)
        {
            Type = (FunctionType)reader.ReadUInt32();

            TypeStringArgData data;

            if (Metadata.TryGetValue(Type, out data))
            {
                Arg1Label = data.Arg1Label;
                Arg2Label = data.Arg2Label;
                Arg1Type  = data.Arg1Type;
                Arg2Type  = data.Arg2Type;

                if (Arg1Type == null)
                {
                    Argument1 = reader.ReadBytes(4);
                }
                else if (Arg1Type == typeof(FormID))
                {
                    Argument1 = new FormID(reader.ReadUInt32());
                }
                else if (Arg1Type == typeof(VATSValue))
                {
                    Argument1 = (VATSValue)reader.ReadUInt32();

                    TypeStringArgData tempData;
                    VATSMetadata.TryGetValue(Argument1, out tempData);

                    Arg2Type  = tempData.Arg1Type;
                    Arg2Label = tempData.Arg1Label;
                }
                else if (Arg1Type.IsEnum)
                {
                    Argument1 = Enum.ToObject(Arg1Type, reader.ReadUInt32());
                }
                else
                {
                    throw new ArgumentException(Arg1Type.ToString() + " is not handled.");
                }

                if (Arg2Type == null)
                {
                    Argument2 = reader.ReadBytes(4);
                }
                else if (Arg2Type == typeof(FormID))
                {
                    Argument2 = new FormID(reader.ReadUInt32());
                }
                else if (Arg2Type.IsEnum)
                {
                    Argument2 = Enum.ToObject(Arg2Type, reader.ReadUInt32());
                }
                else if (Arg2Type == typeof(uint))
                {
                    Argument2 = reader.ReadUInt32();
                }
                else
                {
                    throw new ArgumentException(Arg2Type.ToString() + " is not handled.");
                }
            }
            else
            {
                throw new Exception(Type.ToString() + " was not in the dictionary.");
            }
        }