-
Notifications
You must be signed in to change notification settings - Fork 181
/
DoorTypeExtensions.cs
40 lines (36 loc) · 1.97 KB
/
DoorTypeExtensions.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// -----------------------------------------------------------------------
// <copyright file="DoorTypeExtensions.cs" company="Exiled Team">
// Copyright (c) Exiled Team. All rights reserved.
// Licensed under the CC BY-SA 3.0 license.
// </copyright>
// -----------------------------------------------------------------------
namespace Exiled.API.Extensions
{
using Exiled.API.Enums;
/// <summary>
/// A set of extensions for <see cref="DoorType"/>.
/// </summary>
public static class DoorTypeExtensions
{
/// <summary>
/// Checks if a <see cref="DoorType">door type</see> is a gate.
/// </summary>
/// <param name="door">The door to be checked.</param>
/// <returns>Returns whether the <see cref="DoorType"/> is a gate or not.</returns>
public static bool IsGate(this DoorType door) => door is DoorType.GateA or DoorType.GateB or DoorType.Scp914Gate or
DoorType.Scp049Gate or DoorType.GR18Gate or DoorType.SurfaceGate or DoorType.Scp173Gate;
/// <summary>
/// Checks if a <see cref="DoorType">door type</see> is a checkpoint.
/// </summary>
/// <param name="door">The door to be checked.</param>
/// <returns>Returns whether the <see cref="DoorType"/> is a checkpoint or not.</returns>
public static bool IsCheckpoint(this DoorType door) => door is DoorType.CheckpointLczA or DoorType.CheckpointLczB or DoorType.CheckpointEzHczA or DoorType.CheckpointEzHczB;
/// <summary>
/// Checks if a <see cref="DoorType">door type</see> is an elevator.
/// </summary>
/// <param name="door">The door to be checked.</param>
/// <returns>Returns whether the <see cref="DoorType"/> is an elevator or not.</returns>
public static bool IsElevator(this DoorType door) => door is DoorType.ElevatorGateA or DoorType.ElevatorGateB
or DoorType.ElevatorLczA or DoorType.ElevatorLczB or DoorType.ElevatorNuke or DoorType.ElevatorScp049;
}
}