Update TV example
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user