Exemplo n.º 1
0
 public void Excecute(IStateMaschine stateMaschine)
 {
     Console.WriteLine("Excecuting " + nameof(StateOne));
     if (new Random().Next(0, 2) == 1)
     {
         stateMaschine.SetStateAndExcecute(stateMaschine.GetService <StateTwo>());
     }
     else
     {
         stateMaschine.SetStateAndExcecute(stateMaschine.GetService <StateThree>());
     }
 }
Exemplo n.º 2
0
 public void Excecute(IStateMaschine stateMaschine)
 {
     Console.WriteLine("Excecuting " + nameof(StateTwo));
     Console.WriteLine("Finish Excecuting");
 }
Exemplo n.º 3
0
 public void Excecute(IStateMaschine stateMaschine)
 {
     Console.WriteLine("Excecuting " + nameof(StateThree));
     Console.WriteLine("Welcome to the sink");
 }