Beispiel #1
0
        private string CloseDoor()
        {
            SetMsgColor();

            if (safeDoor != SafeDoor.Open)
            {
                return("Door is already closed.");
            }
            else
            {
                safeDoor = SafeDoor.ClosedUnlocked;
                return("");
            };
        }
Beispiel #2
0
        private string LockDoor()
        {
            SetMsgColor();

            if (safeDoor == SafeDoor.Open)
            {
                return("Door must be closed before locking it.");
            }
            else if (safeDoor == SafeDoor.Locked)
            {
                return("Door is already locked.");
            }
            else
            {
                safeDoor = SafeDoor.Locked;
                return("");
            }
        }
Beispiel #3
0
        private string OpenDoor()
        {
            SetMsgColor();

            if (safeDoor == SafeDoor.Open)
            {
                return("Door is already open.");
            }
            else if (safeDoor == SafeDoor.Locked)
            {
                return("Door is locked, you need to unlock it.");
            }
            else
            {
                safeDoor = SafeDoor.Open;
                return("");
            }
        }
Beispiel #4
0
 private string UnlockDoor()
 {
     safeDoor = SafeDoor.ClosedUnlocked;
     return("");
 }