コード例 #1
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);
        }
コード例 #2
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);
        }