示例#1
0
文件: Team.cs 项目: se-ti/queueing
        public TeamStat GetStat(int day)
        {
            if (m_stat == null)
                m_stat = new List<TeamStat>();

            if (day == m_stat.Count)
            {
                TeamStat stat = new TeamStat(Info) { Start = this.Start };
                m_stat.Add(stat);
                Info.Clear();
            }

            if (day >= 0 && day < m_stat.Count)
                return m_stat[day];

            throw new Exception(String.Format("В команде {0} нет статистики на день {1}", Name, day));
        }
示例#2
0
文件: Team.cs 项目: se-ti/queueing
        public static TeamStat operator +(TeamStat a, TeamStat b)
        {
            var r = new TeamStat();
            r.Start = a.Start != DateTime.MinValue ? a.Start : b.Start;

            r.Time = a.Time + b.Time;
            r.Transit = a.Transit + b.Transit;
            r.Wait = a.Wait + b.Wait;
            r.Reject = a.Reject + b.Reject;
            r.Waits = a.Waits + b.Waits;
            r.RejectComment = Join(a.RejectComment, b.RejectComment);
            r.WaitComment = Join(a.WaitComment, b.WaitComment);

            return r;
        }