Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InteractingElevatorEventArgs"/> class.
 /// </summary>
 /// <param name="player"><inheritdoc cref="Player"/></param>
 /// <param name="elevator"><inheritdoc cref="Elevator"/></param>
 /// <param name="lift"><inheritdoc cref="Type"/></param>
 /// <param name="isAllowed"><inheritdoc cref="IsAllowed"/></param>
 public InteractingElevatorEventArgs(Player player, Lift.Elevator elevator, Lift lift, bool isAllowed = true)
 {
     Lift      = lift;
     Status    = lift.status;
     Player    = player;
     Elevator  = elevator;
     IsAllowed = isAllowed;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="InteractingElevatorEventArgs"/> class.
 /// </summary>
 /// <param name="player"><inheritdoc cref="Player"/></param>
 /// <param name="elevator"><inheritdoc cref="Elevator"/></param>
 /// <param name="lift"><inheritdoc cref="Type"/></param>
 /// <param name="isAllowed"><inheritdoc cref="IsAllowed"/></param>
 public InteractingElevatorEventArgs(Player player, Lift.Elevator elevator, Lift lift, bool isAllowed = true)
 {
     Status    = lift.status;
     Player    = player;
     Elevator  = elevator;
     IsAllowed = isAllowed;
     Type      = GetElevatorType(lift.elevatorName);
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="InteractingElevatorEventArgs"/> class.
        /// </summary>
        /// <param name="player"><inheritdoc cref="Player"/></param>
        /// <param name="elevator"><inheritdoc cref="Elevator"/></param>
        /// <param name="lift"><inheritdoc cref="Type"/></param>
        /// <param name="isAllowed"><inheritdoc cref="IsAllowed"/></param>
        public InteractingElevatorEventArgs(Player player, Lift.Elevator elevator, Lift lift, bool isAllowed = true)
        {
            Lift      = lift;
            Status    = lift.status;
            Player    = player;
            Elevator  = elevator;
            IsAllowed = isAllowed;
#pragma warning disable CS0618 // Type or member is obsolete
            Type = lift.Type();
#pragma warning restore CS0618 // Type or member is obsolete
        }
Esempio n. 4
0
        public static void InvokeElevatorInteract(GameObject player, Lift.Elevator elevator, ref bool allow)
        {
            if (ElevatorInteractEvent == null)
            {
                return;
            }

            ElevatorInteractionEvent ev = new ElevatorInteractionEvent()
            {
                Player   = player.GetPlayer(),
                Elevator = elevator,
                Allow    = allow
            };

            ElevatorInteractEvent.Invoke(ref ev);

            allow = ev.Allow;
        }
Esempio n. 5
0
 public static bool IsClosed(this Lift lift, Lift.Elevator elev)
 {
     for (int i = 0; i < lift.elevators.Length; i++)
     {
         if (lift.elevators[i] == elev)
         {
             if (i == 0)
             {
                 return(lift.NetworkstatusID == (int)Lift.Status.Down);
             }
             else
             {
                 return(lift.NetworkstatusID == (int)Lift.Status.Up);
             }
         }
     }
     return(lift.NetworkstatusID != (int)Lift.Status.Moving);
 }
Esempio n. 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="InteractingElevatorEventArgs"/> class.
 /// </summary>
 /// <param name="player"><inheritdoc cref="Player"/></param>
 /// <param name="elevator"><inheritdoc cref="Elevator"/></param>
 /// <param name="isAllowed"><inheritdoc cref="IsAllowed"/></param>
 public InteractingElevatorEventArgs(Player player, Lift.Elevator elevator, bool isAllowed = true)
 {
     Player    = player;
     Elevator  = elevator;
     IsAllowed = isAllowed;
 }
Esempio n. 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Elevator"/> struct.
 /// </summary>
 /// <param name="elevator">The base <see cref="Lift.Elevator"/> class.</param>
 public Elevator(Lift.Elevator elevator) => Base = elevator;