ARKBreedingStats.Form1.add2Lib C# (CSharp) Метод

add2Lib() приватный Метод

private add2Lib ( bool fromExtractor = true ) : void
fromExtractor bool
Результат void
        private void add2Lib(bool fromExtractor = true)
        {
            CreatureInfoInput input;
            bool bred;
            double te;
            string species;
            if (fromExtractor)
            {
                input = creatureInfoInputExtractor;
                species = Values.V.speciesNames[sE];
                bred = checkBoxAlreadyBred.Checked;
                te = Extraction.E.uniqueTE();
            }
            else
            {
                input = creatureInfoInputTester;
                species = Values.V.speciesNames[cbbStatTestingSpecies.SelectedIndex];
                bred = checkBoxStatTestingBred.Checked;
                te = (double)NumericUpDownTestingTE.Value / 100;
            }

            Creature creature = new Creature(species, input.CreatureName, input.CreatureOwner, input.CreatureGender, getCurrentWildLevels(fromExtractor), getCurrentDomLevels(fromExtractor), te, bred);

            // set parents
            creature.Mother = input.mother;
            creature.Father = input.father;

            // cooldown-, growing-time
            creature.cooldownUntil = input.Cooldown;
            creature.growingUntil = input.Grown;

            creature.domesticatedAt = input.domesticatedAt;

            recalculateCreatureValues(creature);
            creature.recalculateAncestorGenerations();
            creature.guid = Guid.NewGuid();
            creatureCollection.creatures.Add(creature);
            setCollectionChanged(true, species);
            updateCreatureListings(Values.V.speciesNames.IndexOf(species));
            // show only the added creatures' species
            listBoxSpeciesLib.SelectedIndex = listBoxSpeciesLib.Items.IndexOf(creature.species);
            tabControlMain.SelectedTab = tabPageLibrary;

            creatureInfoInputExtractor.parentListValid = false;
            creatureInfoInputTester.parentListValid = false;
        }
Form1