summaryrefslogtreecommitdiff
path: root/DSACore/Models/Network/Group.cs
blob: 76c3efb7f23e75f0bf463563dcabadc99fb7c3f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace DSACore.Models.Network
{
    public class Group
    {
        public Group(string name, string password)
        {
            Name = name;
            Password = password;
        }

        public Group(string name, int userOnline)
        {
            Name = name ?? throw new ArgumentNullException(nameof(name));
        }

        public string Name { get; set; }
        public string Password { get; set; }
        public List<User> Users { get; set; } = new List<User>();

        public int UserCount
        {
            get { return Users.Count; }
        }

        public SendGroup SendGroup()
        {
            return new SendGroup( Name, UserCount);
        }
    }

    public class SendGroup
    {
        public SendGroup(string name, int userCount)
        {
            Name = name ?? throw new ArgumentNullException(nameof(name));
            UserCount = userCount;
        }

        public string Name { get; set; }

        public int UserCount { get; set; }
        
    }
}