forked from ExMod-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.
* Code part of the code has been taken from MER (https://github.com/Michal78900/MapEditorReborn/blob/dev/MapEditorReborn/API/Extensions/LockerExtensions.cs) - Credits to Michal, i ask him i can use it, not answer yet but if the say no i will use another way. * SupplyLocker now have a LockerType Property to know what type of Locker is * LockerSpawnPoint can now chose what locker want to use
- Loading branch information
Showing
4 changed files
with
123 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="LockerType.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> | ||
/// Unique identifier for different types of <see cref="Features.SupplyLocker"/>s. | ||
/// </summary> | ||
public enum LockerType | ||
{ | ||
/// <summary> | ||
/// The pedestal used by SCPs. | ||
/// </summary> | ||
Pedestal, | ||
|
||
/// <summary> | ||
/// Large weapon locker. | ||
/// </summary> | ||
LargeGun, | ||
|
||
/// <summary> | ||
/// Locker for rifles, known as a rifle rack. | ||
/// </summary> | ||
RifleRack, | ||
|
||
/// <summary> | ||
/// Miscellaneous locker for various items. | ||
/// </summary> | ||
Misc, | ||
|
||
/// <summary> | ||
/// Locker that contains medkits. | ||
/// </summary> | ||
Medkit, | ||
|
||
/// <summary> | ||
/// Locker that contains adrenaline. | ||
/// </summary> | ||
Adrenaline, | ||
|
||
/// <summary> | ||
/// Unknow type of locker. | ||
/// </summary> | ||
Unknow | ||
} | ||
} |
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,43 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="LockerExtensions.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 Exiled.API.Enums; | ||
using MapGeneration.Distributors; | ||
|
||
/// <summary> | ||
/// A set of extensions for <see cref="Enums.LockerType"/>. | ||
/// </summary> | ||
public static class LockerExtensions | ||
{ | ||
/// <summary> | ||
/// Gets the <see cref="LockerType"/> from the given <see cref="Locker"/> object. | ||
/// </summary> | ||
/// <param name="locker">The <see cref="Locker"/> to check.</param> | ||
/// <returns>The corresponding <see cref="LockerType"/>.</returns> | ||
public static LockerType GetLockerType(this Locker locker) => locker.name.GetLockerTypeByName(); | ||
|
||
/// <summary> | ||
/// Gets the <see cref="LockerType"/> by name. | ||
/// </summary> | ||
/// <param name="name">The name to check.</param> | ||
/// <returns>The corresponding <see cref="LockerType"/>.</returns> | ||
public static LockerType GetLockerTypeByName(this string name) => name.Replace("(Clone)", string.Empty) switch | ||
{ | ||
"Scp500PedestalStructure Variant" => LockerType.Pedestal, | ||
"LargeGunLockerStructure" => LockerType.LargeGun, | ||
"RifleRackStructure" => LockerType.RifleRack, | ||
"MiscLocker" => LockerType.Misc, | ||
"RegularMedkitStructure" => LockerType.Medkit, | ||
"AdrenalineMedkitStructure" => LockerType.Adrenaline, | ||
_ => LockerType.Unknow, | ||
}; | ||
} | ||
} |
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