Update TV example

This commit is contained in:
Petrutiu Mihai
2016-06-30 10:43:25 +03:00
parent d0ea0a7d56
commit 243a824e19
4 changed files with 27 additions and 9 deletions

View File

@@ -8,9 +8,16 @@ namespace StatePattern.TVExample
{
public class TVOnState : ITVState
{
TVContext context;
public TVOnState(TVContext context)
{
this.context = context;
}
public void OnPowerButtonPresed()
{
Console.WriteLine("TV turning off");
context.State = context.TvOffState;
}
}
}