Exemplo n.º 1
0
        public Feature Feature(int number, DSA_FEATURES type)
        {
            CreateFeature createFeature;
            Feature       feature = Charakter.getFeature(type, number);


            if (feature == null)
            {
                createFeature = new CreateFeature(Charakter.getTalentList_allTalents(), type);
            }
            else
            {
                createFeature = new CreateFeature(feature, Charakter.getTalentList_allTalents(), type);
            }
            createFeature.ShowDialog();
            feature = createFeature.feature();

            if (feature == null)
            {
                return(null);
            }

            Charakter.addFeature(number, feature);

            return(feature);
        }
Exemplo n.º 2
0
        public Feature Feature(int number, DSA_FEATURES type)
        {
            Feature feature = Charakter.getFeature(type, number);
            ControllView_CreateFeature viewController = new ControllView_CreateFeature(Charakter.getTalentList_allTalents());

            if (feature == null)
            {
                feature = new Feature(type);
            }

            feature = viewController.editFeature(feature);
            Charakter.addFeature(number, feature);

            return(feature);
        }
Exemplo n.º 3
0
        private static void loadFeature(XmlNode featureNode, Charakter charakter, DSA_FEATURES type)
        {
            int    i           = 0;
            String BasicString = "Number";

            foreach (XmlNode node in featureNode)
            {
                i++;
                Feature feature = loadFeature(node, charakter, i, type);
                feature.setType(type);

                int    number = 0;
                String Number = node.Name.Substring(BasicString.Length, node.Name.Length - BasicString.Length);

                if (!Int32.TryParse(Number, out number))
                {
                    throw new Exception();
                }
                charakter.addFeature(type, number, feature);
            }
        }
Exemplo n.º 4
0
        private static void loadFeature(XmlNode featureNode, Charakter charakter, DSA_FEATURES type)
        {
            int    i           = 0;
            String BasicString = "Number";

            foreach (XmlNode node in featureNode)
            {
                i++;
                Feature feature = loadFeature(node, charakter, i, type);

                int    number = 0;
                String Number = node.Name.Substring(BasicString.Length, node.Name.Length - BasicString.Length);

                if (!Int32.TryParse(Number, out number))
                {
                    Exception e = new Exception("Fehler bei der Featurenummerierung");
                    Log.throwError(e);
                    throw e;
                }
                charakter.addFeature(number, feature);
            }
        }