forked from Exiled-Team/EXILED
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'apis-rework' into devscp244
- Loading branch information
Showing
103 changed files
with
1,863 additions
and
599 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="WorkstationStatus.cs" company="Exiled Team"> | ||
// Copyright (c) Exiled Team. All rights reserved. | ||
// Licensed under the CC BY-SA 3.0 license. | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace Exiled.API.Enums | ||
{ | ||
/// <summary> | ||
/// All available workstation statuses. | ||
/// </summary> | ||
/// <seealso cref="API.Features.Workstation.CurrentStatus"/> | ||
public enum WorkstationStatus : byte | ||
{ | ||
/// <summary> | ||
/// Workstation is currently offline. | ||
/// </summary> | ||
Offline, | ||
|
||
/// <summary> | ||
/// Workstation is currently powering up. | ||
/// </summary> | ||
PoweringUp, | ||
|
||
/// <summary> | ||
/// Workstation is currently powering down. | ||
/// </summary> | ||
PoweringDown, | ||
|
||
/// <summary> | ||
/// Workstation is currently online. | ||
/// </summary> | ||
Online, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="EnumExtensions.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 System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
/// <summary> | ||
/// Extensions for Enums. | ||
/// </summary> | ||
public static class EnumExtensions | ||
{ | ||
private static Dictionary<Type, IEnumerable<object>> storedEnumValues = new(); | ||
|
||
/// <summary> | ||
/// Queries an enum and returns their values. | ||
/// </summary> | ||
/// <typeparam name="T">The type to return.</typeparam> | ||
/// <returns>An IEnumerable{T} of the enum values from the provided enum.</returns> | ||
public static IEnumerable<T> QueryEnumValue<T>() | ||
where T : Enum | ||
{ | ||
Type type = typeof(T); | ||
|
||
if (!storedEnumValues.ContainsKey(type)) | ||
{ | ||
storedEnumValues.Add(type, Enum.GetValues(type).ToArray<object>()); | ||
} | ||
|
||
return storedEnumValues[type].Cast<T>(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.