public static Machine GetCurrentMachine() { if (_instance == null) { _instance = new MachineFactory(); } return(_instance._currentMachine); }
public static Communicator GetCurrentMachineCommmunicator() { if (_instance == null) { _instance = new MachineFactory(); } return(_instance._com); }
static void Main(string[] args) { var machine = MachineFactory.GetCurrentMachine(); machine.Action1(); MachineFactory.GetCurrentMachineCommmunicator().ExecuteFirstCommand(); Console.ReadLine(); }