Ejemplo n.º 1
0
            public void AddNames(CASAgeGenderFlags species, bool isFemale, Dictionary <string, bool> names)
            {
                Genders genders;

                if (!mNames.TryGetValue(species, out genders))
                {
                    genders = new Genders();
                    mNames.Add(species, genders);

                    Genders loadedGenders;
                    if (mLoadedNames.TryGetValue(species, out loadedGenders))
                    {
                        genders.GetNames(isFemale).AddRange(loadedGenders.GetNames(isFemale));

                        foreach (string name in loadedGenders.GetExclusions(isFemale).Keys)
                        {
                            genders.GetExclusions(isFemale).Add(name, true);
                        }
                    }
                }

                foreach (string name in names.Keys)
                {
                    if (genders.GetExclusions(isFemale).ContainsKey(name))
                    {
                        continue;
                    }

                    genders.GetNames(isFemale).Add(name);
                }

                names.Clear();
            }
Ejemplo n.º 2
0
            public void AddNames(CASAgeGenderFlags species, bool isFemale, Dictionary<string, bool> names)
            {
                Genders genders;
                if (!mNames.TryGetValue(species, out genders))
                {
                    genders = new Genders();
                    mNames.Add(species, genders);

                    Genders loadedGenders;
                    if (mLoadedNames.TryGetValue(species, out loadedGenders))
                    {
                        genders.GetNames(isFemale).AddRange(loadedGenders.GetNames(isFemale));

                        foreach (string name in loadedGenders.GetExclusions(isFemale).Keys)
                        {
                            genders.GetExclusions(isFemale).Add(name, true);
                        }
                    }
                }

                foreach (string name in names.Keys)
                {
                    if (genders.GetExclusions(isFemale).ContainsKey(name)) continue;

                    genders.GetNames(isFemale).Add(name);
                }

                names.Clear();
            }