summaryrefslogtreecommitdiff
path: root/DSACore/Models/Network/Group.cs
blob: aee9d02166a6e7283ccba590053bbae395ebf311 (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
using System;
using System.Collections.Generic;

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 => 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; }
    }
}