Skip to content

Instantly share code, notes, and snippets.

@cyberzed
Created January 9, 2012 22:30
Show Gist options
  • Select an option

  • Save cyberzed/1585339 to your computer and use it in GitHub Desktop.

Select an option

Save cyberzed/1585339 to your computer and use it in GitHub Desktop.
Message abstraction
public abstract class BaseMessage
{
protected string Source;
protected string Destination;
protected string Content;
protected BaseMessage(string source, string destination, string content)
{
Source = source;
Destination = destination;
Content = content;
}
}
public class PrivateMessage : BaseMessage
{
public string Sender { get { return source; } }
public string Receiver { get { return destination; } }
public string Message { get { return content; } }
public PrivateMessage(string sender, string receiver, string message)
: base(sender, receiver, message)
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment