Example #1
0
            public CareerLevelSettings GetSettingsForLevel(string branch, int level, bool create)
            {
                if (!mLevelSettings.ContainsKey(branch))
                {
                    mLevelSettings.Add(branch, new Dictionary <int, CareerLevelSettings>());
                }

                if (!mLevelSettings[branch].ContainsKey(level))
                {
                    if (create)
                    {
                        CareerLevelSettings settings = new CareerLevelSettings(mName, branch, level);
                        CareerLevelSettings cloned   = settings.mDefaults.Clone();
                        cloned.SetDefaults(mName);
                        mLevelSettings[branch].Add(level, cloned);
                        return(cloned);
                    }
                    else
                    {
                        return(null);
                    }
                }

                return(mLevelSettings[branch][level]);
            }