public void Announce(ChatRoomManager manager, string message)
 {
     foreach (var user in users)
     {
         user.Receive(message, "system");
     }
 }
Exemple #2
0
        static void Main(string[] args)
        {
            ChatRoom chatRoom = new ChatRoom();

            ChatRoomManager manager = new ChatRoomManager("Ackerley", chatRoom);
            User            User1   = new User("Maaravi", chatRoom);
            User            User2   = new User("Rachel", chatRoom);

            User1.Send("hi! Rachel");
            User2.Send("hi!");
            manager.Announce("Overload Season 3 is coming!");
            User1.Send("Cooooool!");
            User1.Leave();
            User1.Join(chatRoom);

            manager.DisplayScreen();
            User1.DisplayScreen();
            User2.DisplayScreen();
        }