Skip to content

Instantly share code, notes, and snippets.

@gravypower
Last active December 26, 2015 10:49
Show Gist options
  • Save gravypower/7139553 to your computer and use it in GitHub Desktop.
Save gravypower/7139553 to your computer and use it in GitHub Desktop.
public class House
{
public LivingRoom livingRoom;
public void LivingRoom ()
{
ILcd lcd = new Video();
livingRoom = new LivingRoom(lcd);
livingRoom.EnterRoom();
}
}
public interface ILcd
{
void Show();
}
public class LivingRoom
{
private ILcd lcd;
public LivingRoom(ILcd lcd)
{
this.lcd = lcd;
}
public void EnterRoom()
{
lcd.Show();
}
}
public class Painting : ILcd
{
public void Show()
{
//Display Painting
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment