public void LanguageFamily_loadFile_Garethi()
        {
            Charakter               charakter = new Charakter();
            String                  Resource  = ResourceAcess.getResourceDir("TestResources_LoadLanguageFamily01_Standart");
            String                  file      = ResourceAcess.getLanguageFamilyFile("TestResources_LoadLanguageFamily01_Standart", "Garethi.xml");
            ControllTalent          controll  = new ControllTalent(Resource);
            LoadFile_LanguageFamily loader    = new LoadFile_LanguageFamily();

            charakter.addTalent(controll.getTalentList <LanguageTalent>());
            charakter.addTalent(controll.getTalentList <FontTalent>());

            LanguageFamily family = loader.loadFile(file, charakter);

            Assert.AreEqual(family.getName(), "Garethi-Familie");

            Assert.AreEqual(charakter.getTalent("Garethi"), family.getLanguageTalent(0));
            Assert.AreEqual(charakter.getTalent("Bosparano"), family.getLanguageTalent(1));
            Assert.AreEqual(charakter.getTalent("Aureliani"), family.getLanguageTalent(2));
            Assert.AreEqual("", family.getLanguageTalent(3).getName());

            Assert.AreEqual(charakter.getTalent("Kusliker Zeichen"), family.GetFontTalent(0));
            Assert.AreEqual(charakter.getTalent("Kusliker Zeichen"), family.GetFontTalent(1));
            Assert.AreEqual("", family.GetFontTalent(2).getName());
            Assert.AreEqual(charakter.getTalent("Imperiale Schriftzeichen"), family.GetFontTalent(3));
        }
Exemplo n.º 2
0
        public void Charakter_addTalent_differentType_sameName()
        {
            Charakter       charakter = new Charakter();
            InterfaceTalent talent1   = new TalentCrafting("Talent", RandomGenerator.generateAttributList(), "", new List <TalentDeviate>(), new List <TalentRequirement>());
            InterfaceTalent talent2   = new TalentCrafting("Talent", RandomGenerator.generateAttributList(), "", new List <TalentDeviate>(), new List <TalentRequirement>());

            charakter.addTalent(talent1);
            charakter.addTalent(talent2);

            Assert.AreEqual(1, charakter.getTalentList_allTalents().Count);
        }
Exemplo n.º 3
0
        public void Charakter_addTalent_addDoppel()
        {
            Charakter charakter = new Charakter();

            for (int i = 0; i < talentList.Count; i++)
            {
                charakter.addTalent(talentList[i]);
                charakter.addTalent(talentList[i]);
            }
            Assert.AreEqual(talentList.Count, charakter.getTalentList_allTalents().Count);
        }
        public void LanguageFamily_loadFile_FontTalentisLanguage()
        {
            Charakter               charakter = new Charakter();
            String                  Resource  = ResourceAcess.getResourceDir("TestResources_LoadCharakter02_CorruptFiles");
            String                  file      = ResourceAcess.getLanguageFamilyFile("TestResources_LoadCharakter02_CorruptFiles", "Korrupt_Font_FontisLanguage.xml");
            ControllTalent          controll  = new ControllTalent(Resource);
            LoadFile_LanguageFamily loader    = new LoadFile_LanguageFamily();

            charakter.addTalent(controll.getTalentList <LanguageTalent>());
            charakter.addTalent(controll.getTalentList <FontTalent>());

            LanguageFamily family = loader.loadFile(file, charakter);
        }
        public void LanguageFamily_loadFileNotXML()
        {
            Charakter               charakter = new Charakter();
            String                  Resource  = ResourceAcess.getResourceDir("TestResources_LoadLanguageFamily01_Standart");
            String                  file      = ResourceAcess.getLanguageFamilyFile("TestResources_LoadLanguageFamily01_Standart", "Garethi");
            ControllTalent          controll  = new ControllTalent(Resource);
            LoadFile_LanguageFamily loader    = new LoadFile_LanguageFamily();

            charakter.addTalent(controll.getTalentList <LanguageTalent>());
            charakter.addTalent(controll.getTalentList <FontTalent>());

            LanguageFamily family = loader.loadFile(file, charakter);

            Assert.AreEqual(null, family);
        }
        private Charakter loadCharakter(String ResourceName, String SaveFileName)
        {
            Charakter charakter = new Charakter();
            String    path;

            path           = Path.Combine(ManagmentSaveStrings.currentDirectory, ManagmentSaveStrings.Recources);
            path           = Path.Combine(path, ResourceName);
            controllTalent = new ControllTalent(path);
            path           = Path.Combine(path, ManagmentSaveStrings.SaveLocation);
            path           = Path.Combine(path, SaveFileName);

            List <InterfaceTalent> list = new List <InterfaceTalent>();

            list.AddRange(controllTalent.getTalentList <TalentClose>());
            list.AddRange(controllTalent.getTalentList <TalentRange>());
            list.AddRange(controllTalent.getTalentList <TalentWeaponless>());

            list.AddRange(controllTalent.getTalentList <TalentCrafting>());
            list.AddRange(controllTalent.getTalentList <TalentKnwoldage>());
            list.AddRange(controllTalent.getTalentList <TalentNature>());
            list.AddRange(controllTalent.getTalentList <TalentPhysical>());
            list.AddRange(controllTalent.getTalentList <TalentSocial>());

            list.AddRange(controllTalent.getTalentList <LanguageTalent>());
            list.AddRange(controllTalent.getTalentList <FontTalent>());
            charakter.addTalent(list);

            charakter = LoadCharakterXML.loadCharakter(path, charakter, this.controllTalent);
            return(charakter);
        }
Exemplo n.º 7
0
        public void LanguageFamily_loadFile_Garethi()
        {
            Charakter charakter = new Charakter();
            String    Resource  = ResourceAcess.getResourceDir("TestResources_LoadLanguageFamily01_Standart");;

            ControllTalent controll = new ControllTalent(Resource);

            charakter.addTalent(controll.getTalentList <LanguageTalent>());
            charakter.addTalent(controll.getTalentList <FontTalent>());

            ControllLanguageFamily familyController = new ControllLanguageFamily(charakter, Resource);

            Assert.AreEqual(1, familyController.getFamilyList().Count);
            Assert.AreEqual(charakter.getTalent("Garethi"), familyController.getFamilyList()[0].getLanguageTalent(0));
            Assert.AreEqual(charakter.getTalent("Imperiale Schriftzeichen"), familyController.getFamilyList()[0].GetFontTalent(3));
        }
Exemplo n.º 8
0
        private void setUP_Talente()
        {
            talentList          = getTalentList();
            talentTaWDictionary = getTalentTaWDictionary();

            for (int i = 0; i < talentList.Count; i++)
            {
                charakter.addTalent(talentList[i]);
            }
            List <String> keys = new List <string>(talentTaWDictionary.Keys);

            for (int i = 0; i < talentTaWDictionary.Keys.Count; i++)
            {
                int             taw    = 0;
                InterfaceTalent talent = charakter.getTalent(keys[i]);
                if (talentTaWDictionary.TryGetValue(keys[i], out taw))
                {
                    if (talent == null)
                    {
                        throw new Exception("TestFalsch Talent fehlt. " + keys[i]);
                    }
                    talent.setTaw(taw.ToString());
                }
                else
                {
                    throw new Exception();
                }
            }
        }
Exemplo n.º 9
0
        public void Charakter_addTalent_byList()
        {
            Charakter charakter = new Charakter();

            charakter.addTalent(talentList);

            Assert.AreEqual(talentList.Count, charakter.getTalentList_allTalents().Count);
        }
Exemplo n.º 10
0
        public void Charakter_addTalent_NullList()
        {
            Charakter charakter         = new Charakter();
            List <InterfaceTalent> list = null;

            charakter.addTalent(list);

            Assert.AreEqual(0, (charakter.getTalentList_allTalents()).Count);
        }
Exemplo n.º 11
0
        public void Charakter_addTalent_null()
        {
            Charakter       charakter = new Charakter();
            InterfaceTalent talent    = null;

            charakter.addTalent(talent);

            Assert.AreEqual(0, charakter.getTalentList_allTalents().Count);
        }
Exemplo n.º 12
0
        internal List <TalentDeviate> generateTestDeviates()
        {
            List <TalentDeviate> deviateList = new List <TalentDeviate>(0);

            for (int i = 0; i < random.Next(minCountDeviates, maxCountDeviates); i++)
            {
                String name = "Deviate_Talent_" + i + "_" + RandomGenerator.generateName();
                List <DSA_ATTRIBUTE> atl = RandomGenerator.generateAttributList();
                String be = "Be_Deviate_" + RandomGenerator.generateName();

                InterfaceTalent DeviateTestTalent = new TalentCrafting(name, atl, be, new List <TalentDeviate>(0), new List <TalentRequirement>(0));
                TalentDeviate   talentDeviate     = new TalentDeviate(name, random.Next(minDeviateTaW, maxDeviateTaW));

                deviateList.Add(talentDeviate);
                charakter.addTalent(DeviateTestTalent);
            }
            return(deviateList);
        }
Exemplo n.º 13
0
        public void TalentTest_setBonusTaW()
        {
            InterfaceTalent talent    = getTalentWithoutDeviateRequirement();
            Charakter       charakter = RandomGenerator.generateCharacter();
            int             BonusTaw  = generateFeatures(charakter, talent);

            Assert.AreEqual((0).ToString(), talent.getTAWBonus());
            charakter.addTalent(talent);
            Assert.AreEqual(BonusTaw.ToString(), talent.getTAWBonus());
        }