static void Main(string[] args) { TravelManager tm = new TravelManager(); tm.ToIndia(); tm.ToUK(); tm.ToUS(); tm.ToIndia(); Console.ReadLine(); }
public abstract void ToUS(TravelManager tm);
public abstract void ToIndia(TravelManager tm);
public void ChangeState(TravelManager tm, State s) { tm.ChangeState(s); }
public override void ToUS(TravelManager tm) { Console.WriteLine("To US"); ChangeState(tm, US.Instance()); }
public override void ToIndia(TravelManager tm) { Console.WriteLine("Already In India"); }
public override void ToUK(TravelManager tm) { Console.WriteLine("Already In UK"); }
public override void ToIndia(TravelManager tm) { Console.WriteLine("To India"); ChangeState(tm, India.Instance()); }