コード例 #1
0
        public void addTalent(InterfaceTalent talent)
        {
            if (talent == null)
            {
                return;
            }
            if (controll_TalentExist(talent))
            {
                return;
            }
            if (getTalent(talent.getName()) != null)
            {
                return;
            }

            talent.setCharacter(this);
            List <InterfaceTalent> list = null;

            if (TalentDictionary.TryGetValue(talent.GetType(), out list))
            {
                list.Add(talent);
            }
            else
            {
                list = new List <InterfaceTalent>(0);
                TalentDictionary.Add(talent.GetType(), list);
                this.addTalent(talent);
            }
        }
コード例 #2
0
        public List <InterfaceTalent> getTalentList_TalentType(InterfaceTalent talent)
        {
            List <InterfaceTalent> list = null;

            if (!TalentDictionary.TryGetValue(talent.GetType(), out list))
            {
                list = new List <InterfaceTalent>(0);
                TalentDictionary.Add(talent.GetType(), list);
            }
            return(list);
        }
コード例 #3
0
        public void SimpleTest()
        {
            ControllTalent controller;
            String         ResourcePath;

            ResourcePath = ManagmentSaveStrings.currentDirectory;
            ResourcePath = Path.Combine(ResourcePath, ManagmentSaveStrings.Recources);
            ResourcePath = Path.Combine(ResourcePath, "TestResources");
            controller   = new ControllTalent(ResourcePath);

            List <TalentWeaponless> list = controller.getTalentList <TalentWeaponless>();

            Assert.AreEqual(2, list.Count);

            InterfaceTalent talent = controller.getTalent("Raufen");

            Assert.AreEqual(typeof(TalentWeaponless), talent.GetType());

            TalentFighting ftalent = (TalentFighting)talent;

            Assert.AreEqual("BE", ftalent.getBe());
            Assert.AreEqual("0", ftalent.getPA());

            List <TalentNature> ln = controller.getTalentList <TalentNature>();

            Assert.AreEqual(0, ln.Count);
        }
コード例 #4
0
        public void controllInterfaceTalent(InterfaceTalent talent)
        {
            Assert.AreEqual(currentType, talent.GetType());
            Assert.AreEqual(currentName, talent.getName());
            Assert.AreEqual(currentComplexeName, talent.getName());
            Assert.AreEqual(currentProbeCount, talent.getProbeCount());
            Assert.AreEqual(currentProbeStringOne, talent.getProbeStringOne());
            Assert.AreEqual(currentProbeStringTwo, talent.getProbeStringTwo());

            Assert.AreEqual(currentBE, talent.getBe());
            Assert.AreEqual(currentDeviate, talent.getDeviateString());
            Assert.AreEqual(currentTAW, talent.getTaW());
            Assert.AreEqual(currentTAWBonus, talent.getTAWBonus());
        }
コード例 #5
0
        public InterfaceTalent getTalent(InterfaceTalent talent, int number)
        {
            if (talent == null)
            {
                return(null);
            }

            List <InterfaceTalent> list = null;

            if (TalentDictionary.TryGetValue(talent.GetType(), out list))
            {
                if (number < list.Count)
                {
                    return(list[number]);
                }
                return(null);
            }
            else
            {
                list = new List <InterfaceTalent>(0);
                TalentDictionary.Add(talent.GetType(), list);
            }
            return(null);
        }
コード例 #6
0
        private void loadRow(XmlNode rowElement)
        {
            String FontName     = null;
            String LanguageName = null;

            FontTalent     fTalent = null;
            LanguageTalent ltalent = null;

            foreach (XmlNode node in rowElement)
            {
                switch (node.Name)
                {
                case ManagmentXMLStrings.Language: LanguageName = node.InnerText; break;

                case ManagmentXMLStrings.Font: FontName = node.InnerText; break;
                }
            }
            if (0 != String.Compare("", FontName) && FontName != null)
            {
                InterfaceTalent talent = charakter.getTalent(FontName);
                if (talent == null)
                {
                    Log.writeLogLine("Laden der Language Family " + FamilyName + ". Das Talent " + FontName + " exestiert nicht");
                }
                else
                {
                    if (typeof(FontTalent).IsAssignableFrom(talent.GetType()))
                    {
                        fTalent = (FontTalent)charakter.getTalent(FontName);
                    }
                    else
                    {
                        Log.writeLogLine("Laden der Language Family " + FamilyName + ". Das Talent " + talent.getName() + " ist kein FontTalent");
                    }
                }
            }


            if (0 != String.Compare("", LanguageName) && LanguageName != null)
            {
                InterfaceTalent talent = charakter.getTalent(LanguageName);
                if (talent == null)
                {
                    Log.writeLogLine("Laden der Language Family " + FamilyName + ". Das Talent " + LanguageName + " exestiert nicht");
                }
                else
                {
                    if (typeof(LanguageTalent).IsAssignableFrom(talent.GetType()))
                    {
                        ltalent = (LanguageTalent)charakter.getTalent(LanguageName);
                    }
                    else
                    {
                        Log.writeLogLine("Laden der Language Family " + FamilyName + ". Das Talent " + talent.getName() + " ist kein LanguageTalent");
                    }
                }
            }


            if (fTalent == null)
            {
                fTalent = new FontTalent("", new List <string>());
            }
            if (ltalent == null)
            {
                ltalent = new LanguageTalent("", new List <string>());
            }

            LanguageFamily.addLanguageRow(ltalent, fTalent);
        }
コード例 #7
0
ファイル: ControllTalent.cs プロジェクト: Neburel/DSA_Project
        private void checkforDoppelTalents()
        {
            List <InterfaceTalent> talentlist = new List <InterfaceTalent>(0);

            foreach (List <InterfaceTalent> list in TalentDictonary.Values)
            {
                talentlist.AddRange(list);
            }
            for (int i = 0; i < talentlist.Count; i++)
            {
                InterfaceTalent checkTalent = talentlist[i];
                for (int j = i + 1; j < talentlist.Count; j++)
                {
                    InterfaceTalent currentTalent = talentlist[j];
                    if (String.Compare(checkTalent.getName(), currentTalent.getName()) == 0)
                    {
                        throw new FileLoadException("Doppeltes Talent Entdeckt: " + checkTalent.getName() + " mit dem Typ:" + checkTalent.GetType() + " " + currentTalent.GetType() + " BE:" + checkTalent.getBe());
                    }
                }
            }
        }