Exemplo n.º 1
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 "DATA":
                    if (Data == null)
                    {
                        Data = new CasinoData();
                    }

                    Data.ReadBinary(reader);
                    break;

                case "MODL":
                    if (Models == null)
                    {
                        Models = new List <SimpleSubrecord <String> >();
                    }

                    SimpleSubrecord <String> tempMODL = new SimpleSubrecord <String>();
                    tempMODL.ReadBinary(reader);
                    Models.Add(tempMODL);
                    break;

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

                    ModelSlotMachine.ReadBinary(reader);
                    break;

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

                    ModelBlackjackTable.ReadBinary(reader);
                    break;

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

                    ModelRouletteTable.ReadBinary(reader);
                    break;

                case "ICON":
                    if (SlotReelTextures == null)
                    {
                        SlotReelTextures = new List <SimpleSubrecord <String> >();
                    }

                    SimpleSubrecord <String> tempICON = new SimpleSubrecord <String>();
                    tempICON.ReadBinary(reader);
                    SlotReelTextures.Add(tempICON);
                    break;

                case "ICO2":
                    if (BlackjackTextures == null)
                    {
                        BlackjackTextures = new List <SimpleSubrecord <String> >();
                    }

                    SimpleSubrecord <String> tempICO2 = new SimpleSubrecord <String>();
                    tempICO2.ReadBinary(reader);
                    BlackjackTextures.Add(tempICO2);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
Exemplo n.º 2
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("Data", false, out subEle))
            {
                if (Data == null)
                {
                    Data = new CasinoData();
                }

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

                foreach (XElement e in subEle.Elements())
                {
                    SimpleSubrecord <String> tempMODL = new SimpleSubrecord <String>();
                    tempMODL.ReadXML(e, master);
                    Models.Add(tempMODL);
                }
            }
            if (ele.TryPathTo("Model/SlotMachine", false, out subEle))
            {
                if (ModelSlotMachine == null)
                {
                    ModelSlotMachine = new SimpleSubrecord <String>();
                }

                ModelSlotMachine.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Model/BlackjackTable", false, out subEle))
            {
                if (ModelBlackjackTable == null)
                {
                    ModelBlackjackTable = new SimpleSubrecord <String>();
                }

                ModelBlackjackTable.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Model/RouletteTable", false, out subEle))
            {
                if (ModelRouletteTable == null)
                {
                    ModelRouletteTable = new SimpleSubrecord <String>();
                }

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

                foreach (XElement e in subEle.Elements())
                {
                    SimpleSubrecord <String> tempICON = new SimpleSubrecord <String>();
                    tempICON.ReadXML(e, master);
                    SlotReelTextures.Add(tempICON);
                }
            }
            if (ele.TryPathTo("BlackjackTextures", false, out subEle))
            {
                if (BlackjackTextures == null)
                {
                    BlackjackTextures = new List <SimpleSubrecord <String> >();
                }

                foreach (XElement e in subEle.Elements())
                {
                    SimpleSubrecord <String> tempICO2 = new SimpleSubrecord <String>();
                    tempICO2.ReadXML(e, master);
                    BlackjackTextures.Add(tempICO2);
                }
            }
        }