Table of Contents

Class Locker

Namespace
Exiled.API.Features.Lockers
Assembly
Exiled.API.dll

The in-game Locker.

public class Locker : IWrapper<Locker>, IWorldSpace, IPosition, IRotation
Inheritance
Locker
Implements
IWrapper<Locker>
Inherited Members
Extension Methods

Constructors

Locker(Locker)

Initializes a new instance of the Locker class.

public Locker(Locker locker)

Parameters

locker Locker

The encapsulated MapGeneration.Distributors.Locker.

Properties

Base

Gets the base MapGeneration.Distributors.Locker that this class is wrapping.

public Locker Base { get; }

Property Value

Locker

Chambers

Gets the all Chambers in this locker.

public IReadOnlyCollection<Chamber> Chambers { get; }

Property Value

IReadOnlyCollection<Chamber>

GameObject

Gets the Locker UnityEngine.GameObject.

public GameObject GameObject { get; }

Property Value

GameObject

List

Gets a IEnumerable<T> of Locker which contains all the Locker instances.

public static IReadOnlyCollection<Locker> List { get; }

Property Value

IReadOnlyCollection<Locker>

OpenedChambers

Gets or sets an id for manipulating opened chambers.

public ushort OpenedChambers { get; set; }

Property Value

ushort

Position

Gets the position of this object.

public Vector3 Position { get; }

Property Value

Vector3

RandomChamberPosition

Gets a random position from one of the Chambers.

public Vector3 RandomChamberPosition { get; }

Property Value

Vector3

Room

Gets the Room in which the Locker is located.

public Room? Room { get; }

Property Value

Room

Rotation

Gets the rotation of this object.

public Quaternion Rotation { get; }

Property Value

Quaternion

Transform

Gets the Locker UnityEngine.Transform.

public Transform Transform { get; }

Property Value

Transform

Type

Gets the LockerType of the Locker.

public LockerType Type { get; }

Property Value

LockerType

Zone

Gets the ZoneType in which the locker is located.

public ZoneType Zone { get; }

Property Value

ZoneType

Methods

AddItem(Pickup)

Adds an item to a randomly selected locker chamber.

public void AddItem(Pickup item)

Parameters

item Pickup

The Pickup to be added to the locker chamber.

AddItem(ItemType)

Spawns an item of the specified ItemType to the locker by creating a new Pickup.

public void AddItem(ItemType type)

Parameters

type ItemType

The type of item to be added.

Get(LockerType)

Gets an IEnumerable<T> of Locker given the specified LockerType.

public static IEnumerable<Locker> Get(LockerType lockerType)

Parameters

lockerType LockerType

The LockerType to search for.

Returns

IEnumerable<Locker>

An IEnumerable<T> of Locker which contains elements that satisfy the condition.

Get(ZoneType)

Gets a IEnumerable<T> of Locker given the specified ZoneType.

public static IEnumerable<Locker> Get(ZoneType zoneType)

Parameters

zoneType ZoneType

The ZoneType to search for.

Returns

IEnumerable<Locker>

The Locker with the given ZoneType or null if not found.

Get(Locker)

Gets the Locker belonging to the MapGeneration.Distributors.Locker, if any.

public static Locker? Get(Locker locker)

Parameters

locker Locker

The MapGeneration.Distributors.Locker to get.

Returns

Locker

A Locker or null if not found.

Get(Func<Locker, bool>)

Gets a IEnumerable<T> of Locker filtered based on a predicate.

public static IEnumerable<Locker> Get(Func<Locker, bool> predicate)

Parameters

predicate Func<Locker, bool>

The condition to satify.

Returns

IEnumerable<Locker>

A IEnumerable<T> of Locker which contains elements that satisfy the condition.

Random(ZoneType, LockerType)

Gets a random Locker based on the specified filters.

public static Locker? Random(ZoneType zone = ZoneType.Unspecified, LockerType lockerType = LockerType.Unknow)

Parameters

zone ZoneType

The ZoneType to filter by. If unspecified, all zones are considered.

lockerType LockerType

The LockerType to filter by. If unspecified, all locker types are considered.

Returns

Locker

A random Locker object, or null if no matching locker is found.