Projekt

Obecné

Profil

Stáhnout (1.44 KB) Statistiky
| Větev: | Tag: | Revize:
1
using System;
2

    
3
namespace ServerApp.Parser.OutputInfo
4
{
5
    /// <summary>
6
    /// Class representing the number of events in a given time interval a given faculty
7
    /// - shortest possible interval is 1h
8
    /// </summary>
9
    class ActivityInfo
10
    {
11
        /// <summary> Faculty </summary>
12
        public string faculty;
13
        /// <summary> Number of events </summary>
14
        public int amount;
15
        /// <summary> Start of interval </summary>
16
        public DateTime startTime;
17
        /// <summary> Length of interval in hours </summary>
18
        public int intervalLength;
19

    
20
        /// <summary>
21
        /// Constructor
22
        /// </summary>
23
        /// <param name="faculty">Faculty</param>
24
        /// <param name="amount">Number of events</param>
25
        /// <param name="startTime">Start of recorded interval</param>
26
        /// <param name="intervalLength">Length of recorded interval</param>
27
        public ActivityInfo(string faculty, int amount, DateTime startTime, int intervalLength)
28
        {
29
            this.faculty = faculty;
30
            this.amount = amount;
31
            this.startTime = startTime;
32
            this.intervalLength = intervalLength;
33
        }
34

    
35
        /// <summary>
36
        /// To string
37
        /// </summary>
38
        /// <returns>"start time    faculty     number of events"</returns>
39
        public override string ToString()
40
        {
41
            return $"{startTime.ToString()} \t {faculty} \t {amount}";
42
        }
43
    }
44
}
(1-1/3)