Created
June 5, 2021 10:39
-
-
Save ssukhpinder/8062ccced346d18798ce61ec6e02ad85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class User | |
{ | |
private Chatroom _chatroom; | |
private string _name; | |
public User(string name) => this._name = name; | |
public string Name => _name; | |
public Chatroom Chatroom | |
{ | |
set { _chatroom = value; } | |
get => _chatroom; | |
} | |
public void Post(string to, string message) => | |
_chatroom.Post(_name, to, message); | |
public virtual void DM(string from, string message) => | |
Console.WriteLine("{0} to {1}: '{2}'", from, Name, message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment