Skip to content

Commit

Permalink
Sorry @VALERA771
Browse files Browse the repository at this point in the history
  • Loading branch information
SrLicht committed Aug 28, 2024
1 parent ca9d56a commit de8c398
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 33 deletions.
39 changes: 8 additions & 31 deletions EXILED/Exiled.API/Features/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,14 @@ DecontaminationController.Singleton.NetworkDecontaminationOverride is Decontamin
public static ReadOnlyCollection<PocketDimensionTeleport> PocketDimensionTeleports { get; } = TeleportsValue.AsReadOnly();

/// <summary>
/// Gets all <see cref="MapGeneration.Distributors.Locker"/> objects.
/// Gets all <see cref="MapGeneration.Distributors.Locker"/> objects in the current map.
/// </summary>
/// <remarks>
/// This method is obsolete. Use <see cref="Map.ExiledLockers"/> instead to retrieve the <see cref="Lockers.Locker"/> objects directly.
/// This property is obsolete. Use <see cref="Lockers.Locker.List"/> instead to retrieve a collection of all <see cref="Locker"/> instances.
/// </remarks>
[Obsolete("Use Map.ExiledLockers instead")]
[Obsolete("Use Locker.List instead.")]
public static ReadOnlyCollection<MapGeneration.Distributors.Locker> Lockers { get; } = Features.Lockers.Locker.BaseToExiledLockers.Keys.ToList().AsReadOnly();

/// <summary>
/// Gets all <see cref="Lockers.Locker"/> objects.
/// </summary>
/// <remarks>
/// This metod will be renamed to Lockers when <see cref="Map.Lockers"/> is discontinued.
/// </remarks>
public static IReadOnlyCollection<Lockers.Locker> ExiledLockers { get; } = Features.Lockers.Locker.List;

/// <summary>
/// Gets all <see cref="AdminToy"/> objects.
/// </summary>
Expand Down Expand Up @@ -220,29 +212,14 @@ public static void ResetLightsColor()
}

/// <summary>
/// Gets a random <see cref="MapGeneration.Distributors.Locker"/>.
/// Gets a random <see cref="MapGeneration.Distributors.Locker"/> object from the current map.
/// </summary>
/// <remarks>
/// This method is obsolete. Use <see cref="GetRandomLocker(ZoneType, LockerType)"/> instead.
/// to specify the zone and locker type for more precise filtering.
/// This method is obsolete. Use <see cref="Features.Lockers.Locker.Random"/> instead to get a random <see cref="Locker"/> instance.
/// </remarks>
/// <returns>A <see cref="MapGeneration.Distributors.Locker"/> object from any zone and of any type.</returns>
[Obsolete("Use GetRandomLocker(ZoneType, LockerType) instead.")]
public static MapGeneration.Distributors.Locker GetRandomLocker() => Features.Lockers.Locker.Random().Base;

/// <summary>
/// Gets a random <see cref="Lockers.Locker"/> from the specified zone and locker type.
/// </summary>
/// <param name="zone">
/// The <see cref="ZoneType"/> to filter the lockers by. If <see cref="ZoneType.Unspecified"/> is provided, lockers from all zones are considered.
/// </param>
/// <param name="lockerType">
/// The <see cref="LockerType"/> to filter the lockers by. If <see cref="LockerType.Unknow"/> is provided, lockers of any type are considered.
/// </param>
/// <returns>
/// A <see cref="Locker"/> object that matches the specified zone and locker type, or <see langword="null"/> if no matching locker is found.
/// </returns>
public static Lockers.Locker GetRandomLocker(ZoneType zone = ZoneType.Unspecified, LockerType lockerType = LockerType.Unknow) => Features.Lockers.Locker.Random(zone, lockerType);
/// <returns>A randomly selected <see cref="MapGeneration.Distributors.Locker"/> object.</returns>
[Obsolete("Use Locker.Random() instead.")]
public static MapGeneration.Distributors.Locker GetRandomLocker() => Lockers.GetRandomValue();

/// <summary>
/// Gets a random <see cref="Pickup"/>.
Expand Down
4 changes: 2 additions & 2 deletions EXILED/Exiled.API/Features/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3572,11 +3572,11 @@ public void RandomTeleport(Type type)
nameof(Player) => Dictionary.Values.GetRandomValue(),
nameof(Pickup) => Pickup.BaseToPickup.GetRandomValue().Value,
nameof(Ragdoll) => Ragdoll.List.GetRandomValue(),
nameof(Locker) => Map.GetRandomLocker(ZoneType.Unspecified, LockerType.Unknow),
nameof(Locker) => Lockers.Locker.Random().Base,
nameof(Generator) => Generator.List.GetRandomValue(),
nameof(Window) => Window.List.GetRandomValue(),
nameof(Scp914) => Scp914.Scp914Controller,
nameof(LockerChamber) => Map.GetRandomLocker(ZoneType.Unspecified, LockerType.Unknow).Chambers.GetRandomValue(),
nameof(LockerChamber) => Lockers.Locker.Random().Chambers.GetRandomValue().Base,
_ => null,
};

Expand Down

0 comments on commit de8c398

Please sign in to comment.