コード例 #1
0
 /// <summary>
 /// Attempts to open this <c>Gate</c>, if it has not been opened aready.
 /// </summary>
 public bool Open()
 {
     //  check in gate storage if it's already open.
     if (GateStorage.IsOpen(this))
     {
         return(true);
     }
     return(openInner());
 }
コード例 #2
0
        /// <summary>
        /// Checks if this <c>Gate</c> meets its criteria for opening.
        /// </summary>
        /// <returns>If this <c>Gate</c> can be opened returns <c>true</c>; otherwise, <c>false</c>.</returns>
        public bool CanOpen()
        {
            // check in gate storage if the gate is open.
            // gates are only opened once
            if (GateStorage.IsOpen(this))
            {
                return(false);
            }

            return(canOpenInner());
        }
コード例 #3
0
 /// <summary>
 /// Checks if this <c>Gate</c> meets its criteria for opening.
 /// </summary>
 /// <returns>If this <c>Gate</c> can be opened returns <c>true</c>; otherwise <c>false</c>.</returns>
 protected override bool canOpenInner()
 {
     // Gates don't have activation times, they can only be activated once.
     // We are kind of ignoring the activation limit of Schedule here.
     return(Schedule.Approve(GateStorage.IsOpen(this) ? 1 : 0));
 }
コード例 #4
0
 /// <summary>
 /// Determines whether this <c>Gate</c> is open.
 /// </summary>
 /// <returns>If this <c>Gate</c> is open returns <c>true</c>; otherwise, <c>false</c>.</returns>
 public bool IsOpen()
 {
     return(GateStorage.IsOpen(this));
 }