Last active
December 26, 2015 10:49
-
-
Save gravypower/7139553 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 House | |
{ | |
public LivingRoom livingRoom; | |
public void LivingRoom () | |
{ | |
ILcd lcd = new Video(); | |
livingRoom = new LivingRoom(lcd); | |
livingRoom.EnterRoom(); | |
} | |
} |
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 interface ILcd | |
{ | |
void Show(); | |
} |
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 LivingRoom | |
{ | |
private ILcd lcd; | |
public LivingRoom(ILcd lcd) | |
{ | |
this.lcd = lcd; | |
} | |
public void EnterRoom() | |
{ | |
lcd.Show(); | |
} | |
} |
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 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