Exemple #1
0
        public bool Authenticate(Agent.AuthLevel security, Elevator.Floors floor)
        {
            if (security == Agent.AuthLevel.TopSecret)
            {
                return(true);
            }

            if (security == Agent.AuthLevel.Secret)
            {
                if (floor > Elevator.Floors.S)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }

            if (security == Agent.AuthLevel.Confidential)
            {
                if (floor > Elevator.Floors.G)
                {
                    return(false);
                }
                else
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #2
0
 public Agent(AuthLevel security, Elevator.Floors floor)
 {
     SecurityLevel = security;
     CurrentFloor  = floor;
 }