Exemplo n.º 1
0
        //sets the value for a statistics type to a route class
        public void setStatisticsValue(RouteAirlinerClass aClass, StatisticsType type, int value)
        {
            RouteStatisticsItem item = this.Stats.Find(i => i.Type.Shortname == type.Shortname && i.RouteClass == aClass);

            if (item == null)
            {
                this.Stats.Add(new RouteStatisticsItem(aClass, type, value));
            }
            else
            {
                item.Value = value;
            }
        }
Exemplo n.º 2
0
        //returns the value for a statistics type for a route class
        public long getStatisticsValue(RouteAirlinerClass aClass, StatisticsType type)
        {
            RouteStatisticsItem item = this.Stats.Find(i => i.Type.Shortname == type.Shortname && i.RouteClass.Type == aClass.Type);

            if (item == null)
            {
                return(0);
            }
            else
            {
                return(item.Value);
            }
        }