Beispiel #1
0
 public void displayClass(SoldierClass soldierClass)
 {
     displayMetadata(soldierClass.metadata);
     displayExperience(soldierClass.experience);
     displayEquipment(soldierClass.equipment);
     displayAbilities(soldierClass.soldierAbilities);
     displayStats(soldierClass.stats);
 }
        public void loadSoldierClass(SoldierClass soldierClass)
        {
            tInternalName.Text = soldierClass.metadata.internalName;
            tDisplayName.Text = soldierClass.metadata.displayName;
            tDescription.Text = soldierClass.metadata.description;
            tIconString.Text = soldierClass.metadata.iconString;

            formerInternalName = soldierClass.metadata.internalName;
        }
        public SoldierClass addSoldierClass()
        {
            SoldierClass soldierClass = new SoldierClass();

            soldierClass.metadata.internalName = getNewName();
            soldierClass.metadata.displayName  = soldierClass.metadata.internalName;

            return(addSoldierClass(soldierClass));
        }
        public bool saveSoldierClass(string originalInternalName, SoldierClass soldierClass)
        {
            XElement xmlSoldierClass    = getXmlClass(originalInternalName);
            XElement newXmlSoldierClass = new XElement(Conversion.Convert.toXmlSoldierClass(soldierClass));

            xmlSoldierClass.ReplaceWith(newXmlSoldierClass);
            document.Save(fullPath);
            return(true);
        }
        public SoldierClass addSoldierClass(SoldierClass soldierClass)
        {
            XElement xmlSoldierClass = Conversion.Convert.toXmlSoldierClass(soldierClass);

            XElement xmlClasses = getXmlClasses();

            xmlClasses.Add(xmlSoldierClass);

            document.Save(fullPath);

            return(soldierClass);
        }
Beispiel #6
0
        private void bAdd_Click(object sender, EventArgs e)
        {
            SavedSoldiersManager manager         = new SavedSoldiersManager();
            SoldierClass         newSoldierClass = manager.addSoldierClass();

            updateSoldiers();
            selectSoldier(newSoldierClass.metadata.internalName);

            //SoldierClass soldierClass = new SoldierClass();
            //soldierClass.metadata.internalName = "Test";
            //MetadataManager manager = new MetadataManager();
            //manager.newClass = true;
            //manager.Show(this);
        }
Beispiel #7
0
        public SoldierClass(SoldierClass other)
        {
            metadata   = new SoldierClassMetadata(other.metadata);
            experience = new SoldierClassExperience(other.experience);
            equipment  = new SoldierClassEquipment(other.equipment);

            soldierAbilities = new List <SoldierClassAbility>();
            foreach (SoldierClassAbility soldierAbility in other.soldierAbilities)
            {
                soldierAbilities.Add(new SoldierClassAbility(soldierAbility));
            }

            stats = new List <SoldierClassStat>();
            foreach (SoldierClassStat stat in other.stats)
            {
                stats.Add(new SoldierClassStat(stat));
            }
        }
Beispiel #8
0
        public List <SoldierClass> read()
        {
            List <SoldierClass> classes = new List <SoldierClass>();

            XElement        parentElement   = document.Element(Constants.XML_CLASSES);
            List <XElement> soldierElements = parentElement.Elements(Constants.XML_CLASS).ToList();

            foreach (XElement soldierElement in soldierElements)
            {
                SoldierClass soldierClass = new SoldierClass();
                soldierClass.metadata         = readMetadata(soldierElement.Element("metadata"));
                soldierClass.experience       = readExperience(soldierElement.Element("experience"));
                soldierClass.equipment        = readEquipment(soldierElement.Element("equipment"));
                soldierClass.soldierAbilities = readAbilities(soldierElement.Element("abilities"));
                soldierClass.stats            = readStats(soldierElement.Element("stats"));

                classes.Add(soldierClass);
            }

            return(classes);
        }
Beispiel #9
0
 public void addClass(SoldierClass soldierClass)
 {
     XElement parentElement = document.Element(Constants.XML_CLASSES);
 }
Beispiel #10
0
        public void selectSoldier(string internalName)
        {
            SoldierClass soldierClass = soldiers.Where(x => x.metadata.internalName.Equals(internalName)).FirstOrDefault();

            cClass.SelectedIndex = cClass.Items.IndexOf(soldierClass);
        }