Beispiel #1
0
 public override void CheckCurrentState(LMSystem lmSystem)
 {
     if (lmSystem.DoorInRange == true)
     {
         lmSystem.SetState(new DoorInRange());
     }
 }
Beispiel #2
0
 public override void CheckCurrentState(LMSystem lmSystem)
 {
     if (lmSystem.DoorIsLock == false || lmSystem.MarkingIsFinished == true)
     {
         lmSystem.SetState(new DoorInRange());
         lmSystem.MarkingIsFinished = false;
     }
 }
Beispiel #3
0
 public override void CheckCurrentState(LMSystem lmSystem)
 {
     if (lmSystem.DoorInRange == false)
     {
         lmSystem.SetState(new DoorOutOfRange());
     }
     else if (lmSystem.DoorIsLock == true)
     {
         lmSystem.SetState(new DoorIsLocked());
     }
 }
Beispiel #4
0
        static void Main(string[] args)
        {
            LMSystem laserMarkingSystem = new LMSystem();

            Console.WriteLine("{0}\n", laserMarkingSystem.ReturnCurrentState());

            laserMarkingSystem.DoorInRange = true;
            laserMarkingSystem.CheckCurrentState();
            Console.WriteLine("{0}\n", laserMarkingSystem.ReturnCurrentState());

            laserMarkingSystem.DoorInRange = false;
            laserMarkingSystem.CheckCurrentState();
            Console.WriteLine("{0}\n", laserMarkingSystem.ReturnCurrentState());

            laserMarkingSystem.DoorIsLock = true;
            laserMarkingSystem.CheckCurrentState();
            Console.WriteLine("{0}\n", laserMarkingSystem.ReturnCurrentState());

            laserMarkingSystem.DoorInRange = true;
            laserMarkingSystem.CheckCurrentState();
            Console.WriteLine("{0}\n", laserMarkingSystem.ReturnCurrentState());

            Console.ReadKey();
        }
Beispiel #5
0
 public abstract void CheckCurrentState(LMSystem lmSystem);