Exemple #1
0
        static void Main(string[] args)
        {
            TextChat chat = new TextChat();

            IUser admin = new Admin(chat, "Иван Иваныч");
            IUser user1 = new SimpleUser(chat, "Sergey");
            IUser user2 = new SimpleUser(chat, "Dasha");
            IUser user3 = new SimpleUser(chat, "Masha");

            user2.setEnable(false);

            chat.setAdmin(admin);
            chat.addUser(user1);
            chat.addUser(user2);
            chat.addUser(user3);

            user1.sendMessage("Hello, I'm user");
            admin.sendMessage("Admin online!!!");
        }