Exemple #1
0
        public Party(DataStore data)
            : this()
        {
            Clock = new Clock();

            InitCharacters(data);

            AddCharacters();

            _party[0] = Cloud;

            Materiatory = new Materiatory();
            Inventory   = new Inventory();
            Reserves    = new Character[3, 3];

            Gil = 100;

            BattleSpeed = DEFAULT_BATTLE_SPEED;
        }
Exemple #2
0
        public Party(DataStore data)
            : this()
        {
            Clock = new Clock();

            InitCharacters(data);

            AddCharacters();

            _party[0] = Cloud;

            Materiatory = new Materiatory();
            Inventory = new Inventory();
            Reserves = new Character[3, 3];

            Gil = 100;

            BattleSpeed = DEFAULT_BATTLE_SPEED;
        }
Exemple #3
0
        public Party(DataStore data, XmlNode savegame)
            : this()
        {
            InitCharacters(savegame, data);

            AddCharacters();

            for (int k = 0; k <= 2; k++)
            {
                XmlNode node = savegame.SelectSingleNode("./slot" + k.ToString());

                if (node != null)
                {
                    if (!String.IsNullOrEmpty(node.InnerText))
                    {
                        _party[k] = _characters[node.InnerText];
                    }
                }
            }

            Materiatory = new Materiatory(data, savegame);
            Inventory   = new Inventory(data, savegame);
            Reserves    = new Character[3, 3];

            int i = 0;
            int j = 0;

            foreach (XmlNode node in savegame.SelectNodes("./reserve"))
            {
                if (node.NodeType == XmlNodeType.Comment)
                {
                    continue;
                }

                Reserves[j, i] = _characters[node.InnerXml];
                i++;
                if (i % 3 == 0)
                {
                    j++;
                    i = 0;
                }
            }

            Gil = Int32.Parse(savegame.SelectSingleNode("./gil").InnerXml);

            int time = Int32.Parse(savegame.SelectSingleNode("./time").InnerText);

            Clock = new Clock(time, true);

            BattleSpeed = Int32.Parse(savegame.SelectSingleNode("./battleSpeed").InnerText);



            for (int a = 0; a < 4; a++)
            {
                XmlNode cornerNode = savegame.SelectSingleNode("./config/menu/corner" + a);

                int r = Int32.Parse(cornerNode.Attributes["r"].Value);
                int g = Int32.Parse(cornerNode.Attributes["g"].Value);
                int b = Int32.Parse(cornerNode.Attributes["b"].Value);

                Menu.Menu.SetCornerColor(a, r, g, b);
            }
        }
Exemple #4
0
        public void SaveToFile(string path)
        {
            using (StreamWriter sw = new StreamWriter(path))
                using (XmlWriter writer = XmlWriter.Create(sw, Resource.XmlWriterSettings))
                {
                    writer.WriteStartElement("party");

                    writer.WriteStartElement("characters");
                    Cloud.WriteToXml(writer);
                    Tifa.WriteToXml(writer);
                    Barret.WriteToXml(writer);
                    Aeris.WriteToXml(writer);
                    RedXIII.WriteToXml(writer);
                    CaitSith.WriteToXml(writer);
                    Yuffie.WriteToXml(writer);
                    Vincent.WriteToXml(writer);
                    Cid.WriteToXml(writer);
                    Sephiroth.WriteToXml(writer);
                    writer.WriteEndElement(); // characters

                    for (int i = 0; i < PARTY_SIZE; i++)
                    {
                        writer.WriteElementString("slot" + i, this[i].Name);
                    }

                    foreach (Character c in Reserves)
                    {
                        if (c != null)
                        {
                            writer.WriteElementString("reserve", c.Name);
                        }
                    }

                    Inventory.WriteToXml(writer);
                    Materiatory.WriteToXml(writer);

                    writer.WriteElementString("gil", Gil.ToString());
                    writer.WriteElementString("time", Clock.TotalMilliseconds.ToString());

                    writer.WriteStartElement("config");
                    writer.WriteStartElement("menu");

                    for (int i = 0; i < 4; i++)
                    {
                        int r, g, b;

                        Menu.Menu.GetCornerColor(i, out r, out g, out b);

                        writer.WriteStartElement("corner" + i.ToString());
                        writer.WriteAttributeString("r", r.ToString());
                        writer.WriteAttributeString("g", g.ToString());
                        writer.WriteAttributeString("b", b.ToString());
                        writer.WriteEndElement(); // corner
                    }

                    writer.WriteEndElement(); // menu
                    writer.WriteEndElement(); // config

                    writer.WriteEndElement(); // party
                }
        }
Exemple #5
0
        public Party(DataStore data, XmlNode savegame)
            : this()
        {
            InitCharacters(savegame, data);

            AddCharacters();

            for (int k = 0; k <= 2; k++)
            {
                XmlNode node = savegame.SelectSingleNode("./slot" + k.ToString());

                if (node != null)
                {
                    if (!String.IsNullOrEmpty(node.InnerText))
                    {
                        _party[k] = _characters[node.InnerText];
                    }
                }
            }

            Materiatory = new Materiatory(data, savegame);
            Inventory = new Inventory(data, savegame);
            Reserves = new Character[3, 3];

            int i = 0;
            int j = 0;

            foreach (XmlNode node in savegame.SelectNodes("./reserve"))
            {
                if (node.NodeType == XmlNodeType.Comment)
                {
                    continue;
                }

                Reserves[j, i] = _characters[node.InnerXml];
                i++;
                if (i % 3 == 0)
                {
                    j++;
                    i = 0;
                }
            }

            Gil = Int32.Parse(savegame.SelectSingleNode("./gil").InnerXml);

            int time = Int32.Parse(savegame.SelectSingleNode("./time").InnerText);
            Clock = new Clock(time, true);

            BattleSpeed = Int32.Parse(savegame.SelectSingleNode("./battleSpeed").InnerText);

            for (int a = 0; a < 4; a++)
            {
                XmlNode cornerNode = savegame.SelectSingleNode("./config/menu/corner" + a);

                int r = Int32.Parse(cornerNode.Attributes["r"].Value);
                int g = Int32.Parse(cornerNode.Attributes["g"].Value);
                int b = Int32.Parse(cornerNode.Attributes["b"].Value);

                Menu.Menu.SetCornerColor(a, r, g, b);
            }
        }