Example #1
0
        public void ControllView_CreateFeatureTests_removeBonus()
        {
            Random rand = new Random();
            List <InterfaceTalent> tlist   = getTalentList();
            InterfaceTalent        talenta = new TalentCrafting("CraftingTalent", RandomGenerator.generateAttributList(), "BE", new List <TalentDeviate>(), new List <TalentRequirement>());

            tlist.Add(talenta);

            ControllView_CreateFeature controll = new ControllView_CreateFeature(tlist);
            Feature feature = new Feature(DSA_FEATURES.VORTEIL);

            controll.setFeature(feature);

            List <String> list = controll.TalentewithBonus();

            Assert.AreEqual(0, list.Count);

            controll.setTawBonus("CraftingTalent", "10");

            Assert.AreEqual(10, feature.getTaWBonus(talenta));
            Assert.AreEqual(10, controll.getTawBonus("CraftingTalent"));

            controll.removeTawBonus("CraftingTalent");

            Assert.AreEqual(0, feature.getTaWBonus(talenta));
            Assert.AreEqual(0, controll.getTawBonus("CraftingTalent"));
        }
Example #2
0
        public void DescriptionWithTalent()
        {
            String Name        = "Name_" + RandomGenerator.generateName();
            String Description = "Description_" + RandomGenerator.generateName();
            String GP          = "GP" + RandomGenerator.generateName();
            String Value       = (random.Next(maxValue)).ToString();

            Feature AD_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.VORTEIL);
            Feature DI_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.NACHTEIL);

            TalentCrafting testTalent = new TalentCrafting("CraftingTalent", new List <DSA_ATTRIBUTE>(), "", new List <TalentDeviate>(), new List <TalentRequirement>());

            AD_feature.addTalent(testTalent, 10);
            DI_feature.addTalent(testTalent, 10);

            setAttributValues(AD_feature);
            setAttributValues(DI_feature);

            setEnergieValues(AD_feature);
            setEnergieValues(DI_feature);

            setAdvancedValues(AD_feature);
            setAdvancedValues(DI_feature);

            String ADDescription = (getDescription(DSA_FEATURES.VORTEIL, Description)) + ", CraftingTalent(10)";
            String DIDescription = (getDescription(DSA_FEATURES.NACHTEIL, Description)) + ", CraftingTalent(-10)";

            Assert.AreEqual(ADDescription, AD_feature.getDescription());
            Assert.AreEqual(DIDescription, DI_feature.getDescription());
        }
Example #3
0
        public void TalentTest_notExistingDiverate()
        {
            TalentCrafting craftingTalent = new TalentCrafting("notExist", RandomGenerator.generateAttributList(), "", new List <TalentDeviate> {
                new TalentDeviate("____", 0)
            }, new List <TalentRequirement>());

            charakter.addTalent(craftingTalent);
            craftingTalent.setTaw("10");
            Assert.Fail();
        }
Example #4
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);
        }
        public void ControllClass_SimpleTest_TalentListnotExist()
        {
            TalentCrafting crafting = new TalentCrafting("Test", new List <DSA_ATTRIBUTE>(), "BE", new List <TalentDeviate>(), new List <TalentRequirement>());
            GiftTalent     gift     = new GiftTalent("Test2", new List <DSA_ATTRIBUTE>());

            List <TalentCrafting>  controllerList = controll.getTalentListController <TalentCrafting>();
            List <InterfaceTalent> talentListChar = controll.getTalentList(gift);
            List <InterfaceTalent> allTalentList  = controll.getallTalentList();

            Assert.AreEqual(0, talentListChar.Count);
        }
Example #6
0
        private List <InterfaceTalent> getTalentList()
        {
            List <InterfaceTalent> list    = new List <InterfaceTalent>();
            InterfaceTalent        talenta = new TalentCrafting("Crafting", RandomGenerator.generateAttributList(), "BE", new List <TalentDeviate>(), new List <TalentRequirement>());
            InterfaceTalent        talentb = new TalentNature("Nature", RandomGenerator.generateAttributList(), "BE", new List <TalentDeviate>(), new List <TalentRequirement>());
            InterfaceTalent        talentc = new TalentKnwoldage("Knowldage", RandomGenerator.generateAttributList(), "BE", new List <TalentDeviate>(), new List <TalentRequirement>());
            InterfaceTalent        talentd = new TalentPhysical("Physical", RandomGenerator.generateAttributList(), "BE", new List <TalentDeviate>(), new List <TalentRequirement>());

            list.Add(talenta);
            list.Add(talentb);
            list.Add(talentc);
            list.Add(talentd);

            return(list);
        }
Example #7
0
        public void TalentValueUnknownTalent()
        {
            String Name        = "Name_" + RandomGenerator.generateName();
            String Description = "Description_" + RandomGenerator.generateName();
            String GP          = "GP" + RandomGenerator.generateName();
            String Value       = (random.Next(maxValue)).ToString();

            Feature AD_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.VORTEIL);
            Feature DI_feature = new Feature(Name, Description, Value, GP, DSA_FEATURES.NACHTEIL);

            TalentCrafting testTalent = new TalentCrafting("", new List <DSA_ATTRIBUTE>(), "", new List <TalentDeviate>(), new List <TalentRequirement>());

            Assert.AreEqual(0, AD_feature.getTaWBonus(testTalent));
            Assert.AreEqual(0, DI_feature.getTaWBonus(testTalent));
        }
Example #8
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);
        }
Example #9
0
        internal List <TalentRequirement> generateTestRequirements()
        {
            List <TalentRequirement> requirementList = new List <TalentRequirement>(0);

            for (int i = 0; i < random.Next(maxCountRequiremnts); i++)
            {
                String name = "Requirement_Talent" + RandomGenerator.generateName();
                List <DSA_ATTRIBUTE> at1 = RandomGenerator.generateAttributList();
                String be = "Be_Deviate_" + RandomGenerator.generateName();

                InterfaceTalent   DeviateTestTalent = new TalentCrafting(name, at1, be, new List <TalentDeviate>(0), new List <TalentRequirement>(0));
                TalentRequirement talentRequirement = new TalentRequirement(name, random.Next(maxRequirementTaW), maxRequirmentTaWat);

                requirementList.Add(talentRequirement);
                charakter.addTalent(DeviateTestTalent);
            }

            return(requirementList);
        }
Example #10
0
        public void ControllClass_SimpleTest_Talente()
        {
            TalentCrafting crafting = new TalentCrafting("Test", new List <DSA_ATTRIBUTE>(), "BE", new List <TalentDeviate>(), new List <TalentRequirement>());

            controll.addTalent(crafting);

            List <TalentCrafting>  controllerList = controll.getTalentListController <TalentCrafting>();
            List <InterfaceTalent> talentListChar = controll.getTalentList(crafting);
            List <InterfaceTalent> allTalentList  = controll.getallTalentList();

            InterfaceTalent talent = controll.getTalent(crafting, controllerList.Count);

            Assert.AreEqual(crafting, talent);
            Assert.AreEqual(controllerList.Count + 1, talentListChar.Count);

            controll.setTaw("5", "Test");

            Assert.AreEqual(5.ToString(), crafting.getTaW());
        }
Example #11
0
        public void ControllView_CreateFeatureTests_getTalentbyName()
        {
            Random rand = new Random();
            List <InterfaceTalent> tlist = getTalentList();
            InterfaceTalent        talenta;

            talenta = new TalentCrafting("ACrafting", RandomGenerator.generateAttributList(), "BE", new List <TalentDeviate>(), new List <TalentRequirement>());
            tlist.Add(talenta);
            talenta = new TalentCrafting("CraftingTalent", RandomGenerator.generateAttributList(), "BE", new List <TalentDeviate>(), new List <TalentRequirement>());
            tlist.Add(talenta);

            ControllView_CreateFeature controll = new ControllView_CreateFeature(tlist);
            Feature feature = new Feature(DSA_FEATURES.VORTEIL);

            controll.setFeature(feature);

            List <InterfaceTalent> list = controll.getTalentList();

            Assert.AreEqual(tlist, list);
        }
Example #12
0
        public override Dictionary <Feature, int> getFeatureDictionary()
        {
            Dictionary <Feature, int> dic = new Dictionary <Feature, int>(0);

            Feature feature1 = new Feature("F1", "F1", "0", "0", DSA_FEATURES.VORTEIL);
            Feature feature2 = new Feature("F2", "F2", "10", "7", DSA_FEATURES.VORTEIL);
            Feature feature3 = new Feature("F3", "F3", "2", "8", DSA_FEATURES.NACHTEIL);

            TalentCrafting talent = new TalentCrafting("Crafting", RandomGenerator.generateAttributList(), "BE", new List <TalentDeviate>(), new List <TalentRequirement>());

            dic.Add(feature1, 1);
            dic.Add(feature2, 2);
            dic.Add(feature3, 3);

            feature1.setAdvancedValues(DSA_ADVANCEDVALUES.FERNKAMPF_BASIS, 20);
            feature1.addTalent(talent, 5);
            feature2.setEnergieBonus(DSA_ENERGIEN.AUSDAUER, 8);
            feature3.setAttributeBonus(DSA_ATTRIBUTE.IN, 9);

            return(dic);
        }
Example #13
0
        public override List <InterfaceTalent> getTalentList()
        {
            List <InterfaceTalent> list = new List <InterfaceTalent>(0);

            InterfaceTalent talent01 = new TalentCrafting("CraftingTalent01", RandomGenerator.generateAttributList(), "Crafting_BE", new List <TalentDeviate>(), new List <TalentRequirement>());
            InterfaceTalent talent02 = new TalentKnwoldage("TalentKnowldage", RandomGenerator.generateAttributList(), "Crafting_BE", new List <TalentDeviate>(), new List <TalentRequirement>());
            InterfaceTalent talent03 = new TalentPhysical("TalentPhysical1", RandomGenerator.generateAttributList(), "Crafting_BE", new List <TalentDeviate>(), new List <TalentRequirement>());
            InterfaceTalent talent04 = new TalentPhysical("TalentPhysical2", RandomGenerator.generateAttributList(), "Crafting_BE", new List <TalentDeviate>(), new List <TalentRequirement>());
            InterfaceTalent talent05 = new GiftTalent("GiftTalent", RandomGenerator.generateAttributList());
            InterfaceTalent talent06 = new TalentClose("TalentClose", "BE_Close", new List <TalentDeviate>(), DSA_ADVANCEDVALUES.ATTACKE_BASIS, true);
            InterfaceTalent talent07 = new TalentCrafting("CraftingTalent02", RandomGenerator.generateAttributList(), "Crafting_BE", new List <TalentDeviate>(), new List <TalentRequirement>());
            InterfaceTalent talent08 = new TalentWeaponless("TalentClose01", "BE_Close", new List <TalentDeviate>(), DSA_ADVANCEDVALUES.ATTACKE_BASIS, true);

            list.Add(talent01);
            list.Add(talent02);
            list.Add(talent03);
            list.Add(talent04);
            list.Add(talent05);
            list.Add(talent06);
            list.Add(talent07);
            list.Add(talent08);

            return(list);
        }
Example #14
0
 public void ProbeNullTestRequirement()
 {
     TalentCrafting talent = new TalentCrafting("", null, "", new List <TalentDeviate>(), new List <TalentRequirement>());
 }
Example #15
0
 public void TalentRequirementNullTestRequirement()
 {
     TalentCrafting talent = new TalentCrafting("", new List <DSA_ATTRIBUTE>(), "", new List <TalentDeviate>(), null);
 }
Example #16
0
        private static ITalent CreateTalent(string contentType, Guid guid = new Guid(), List <CharakterAttribut> probe = null, int orginalPos = -1)
        {
            ITalent talent = null;

            contentType = contentType.Trim();

            if (guid == new Guid() || guid == null)
            {
                guid = guid.GenerateNextGuid(talentGuids);
                talentGuids.Add(guid);
            }

            if (contentType == nameof(TalentWeaponless))
            {
                talent = new TalentWeaponless(guid);
            }
            else if (contentType == nameof(TalentClose))
            {
                talent = new TalentClose(guid);
            }
            else if (contentType == nameof(TalentRange))
            {
                talent = new TalentRange(guid);
            }
            else if (contentType == nameof(TalentCrafting))
            {
                talent = new TalentCrafting(guid, probe);
            }
            else if (contentType == nameof(TalentKnowldage))
            {
                talent = new TalentKnowldage(guid, probe);
            }
            else if (contentType == nameof(TalentNature))
            {
                talent = new TalentNature(guid, probe);
            }
            else if (contentType == nameof(TalentPhysical))
            {
                talent = new TalentPhysical(guid, probe);
            }
            else if (contentType == nameof(TalentSocial))
            {
                talent = new TalentSocial(guid, probe);
            }
            else if (contentType == nameof(TalentSpeaking) || contentType == "TalentLanguage")
            {
                //TalentLanguage ist ein Relikt das aber vorhanden sein muss damit man alte Save dateien Laden kann
                talent = new TalentSpeaking(guid);
            }
            else if (contentType == nameof(TalentWriting))
            {
                talent = new TalentWriting(guid);
            }
            else
            {
                throw new TalentException(
                          error: ErrorCode.Error,
                          message: Resources.ErrorUnknownTalentType);
            }
            talent.OrginalPosition = orginalPos;
            return(talent);
        }
Example #17
0
 public void allNullTestRequirement()
 {
     TalentCrafting talent = new TalentCrafting("", null, "", null, null);
 }