Ejemplo n.º 1
0
        public Stat AddStat(APIMember Member, string Name)
        {
            for (APIPage Page = Member; Page != null; Page = Page.Parent)
            {
                APIModule Module = Page as APIModule;
                if (Module != null)
                {
                    // Get the stats for this module
                    ModuleStats ModuleStatsInst;
                    if (!Modules.TryGetValue(Module.Name, out ModuleStatsInst))
                    {
                        ModuleStatsInst = new ModuleStats();
                        Modules.Add(Module.Name, ModuleStatsInst);
                    }

                    // Find the name of this stat
                    Stat StatInst;
                    if (!ModuleStatsInst.Stats.TryGetValue(Name, out StatInst))
                    {
                        StatInst = new Stat();
                        ModuleStatsInst.Stats.Add(Name, StatInst);
                    }

                    // Update the current
                    return(StatInst);
                }
            }
            return(null);
        }
Ejemplo n.º 2
0
		public Stat AddStat(APIMember Member, string Name)
		{
			for(APIPage Page = Member; Page != null; Page = Page.Parent)
			{
				APIModule Module = Page as APIModule;
				if(Module != null)
				{
					// Get the stats for this module
					ModuleStats ModuleStatsInst;
					if(!Modules.TryGetValue(Module.Name, out ModuleStatsInst))
					{
						ModuleStatsInst = new ModuleStats();
						Modules.Add(Module.Name, ModuleStatsInst);
					}

					// Find the name of this stat
					Stat StatInst;
					if (!ModuleStatsInst.Stats.TryGetValue(Name, out StatInst))
					{
						StatInst = new Stat();
						ModuleStatsInst.Stats.Add(Name, StatInst);
					}

					// Update the current 
					return StatInst;
				}
			}
			return null;
		}