Beispiel #1
0
        public bool Test()
        {
            XmlDocument doc = new XmlDocument();

            doc.AppendChild(doc.CreateElement("root"));
            Tag t = new Tag()
            {
                Bonus       = 1.4f,
                BonusTarget = "BonusMove",
                Operation   = SupportedOperations.Multiply,
                TagType     = TagType.StatEnhancing,
                Description = "Testy stuff",
            };

            t.SaveXmlRoot(doc);
            foreach (Armor armor in BeastFactory.BoneArmor)
            {
                armor.SaveXmlRoot(doc);
            }

            RangedAttackTag tag = new RangedAttackTag
            {
                AbsoluteLevel = 12, Accuracy = 13, Ammo = 1, AttackName = "Pewpewpew", BaseStat = BaseStat.DX,
                Difficulty    = 13
            };
            var clonetest = tag.Clone() as RangedAttackTag;

            if (!(tag.AbsoluteLevel == clonetest?.AbsoluteLevel &&
                  tag.Accuracy == clonetest.Accuracy &&
                  tag.Ammo == clonetest.Ammo &&
                  tag.AttackName == clonetest.AttackName &&
                  tag.BaseStat == clonetest.BaseStat &&
                  tag.Difficulty == clonetest.Difficulty))
            {
                return(false);
            }

            clonetest.AttackName = "KEYKEYKEY";
            if (tag.AttackName == clonetest.AttackName)
            {
                return(false);
            }



            BodyPlan b = new BodyPlan();

            b = BeastFactory.BodyPlans[12];
            b.SaveXmlRoot(doc);

            Milieu m = new Milieu();

            m = BeastFactory.Milieux[3];
            m.SaveXmlRoot(doc);
            doc.Save("tagTest.xml");
            t.LoadXml(doc.DocumentElement.LastChild as XmlElement);

            return(true);
        }
Beispiel #2
0
        public override object Clone()
        {
            RangedAttackTag clone = new RangedAttackTag();

            Copy(this, clone);


            return(clone);
        }