Show / Hide Table of Contents

Class VendingMachineSystem

Inheritance
System.Object
SharedVendingMachineSystem
VendingMachineSystem
Namespace: Content.Server.VendingMachines
Assembly: Content.Server.dll
Syntax
public sealed class VendingMachineSystem : SharedVendingMachineSystem

Methods

| Improve this Doc View Source

AuthorizedVend(EntityUid, EntityUid, InventoryType, String, VendingMachineComponent)

Checks whether the user is authorized to use the vending machine, then ejects the provided item if true

Declaration
public void AuthorizedVend(EntityUid uid, EntityUid sender, InventoryType type, string itemId, VendingMachineComponent component)
Parameters
Type Name Description
EntityUid uid
EntityUid sender

Entity that is trying to use the vending machine

InventoryType type

The type of inventory the item is from

System.String itemId

The prototype ID of the item

VendingMachineComponent component
| Improve this Doc View Source

Deny(EntityUid, VendingMachineComponent)

Declaration
public void Deny(EntityUid uid, VendingMachineComponent vendComponent = null)
Parameters
Type Name Description
EntityUid uid
VendingMachineComponent vendComponent
| Improve this Doc View Source

EjectRandom(EntityUid, Boolean, Boolean, VendingMachineComponent)

Ejects a random item from the available stock. Will do nothing if the vending machine is empty.

Declaration
public void EjectRandom(EntityUid uid, bool throwItem, bool forceEject = false, VendingMachineComponent vendComponent = null)
Parameters
Type Name Description
EntityUid uid
System.Boolean throwItem

Whether to throw the item in a random direction after dispensing it.

System.Boolean forceEject

Whether to skip the regular ejection checks and immediately dispense the item without animation.

VendingMachineComponent vendComponent
| Improve this Doc View Source

Initialize()

Declaration
public override void Initialize()
Overrides
SharedVendingMachineSystem.Initialize()
| Improve this Doc View Source

IsAuthorized(EntityUid, EntityUid, VendingMachineComponent)

Checks if the user is authorized to use this vending machine

Declaration
public bool IsAuthorized(EntityUid uid, EntityUid sender, VendingMachineComponent vendComponent = null)
Parameters
Type Name Description
EntityUid uid
EntityUid sender

Entity trying to use the vending machine

VendingMachineComponent vendComponent
Returns
Type Description
System.Boolean
| Improve this Doc View Source

OnComponentInit(EntityUid, VendingMachineComponent, ComponentInit)

Declaration
protected override void OnComponentInit(EntityUid uid, VendingMachineComponent component, ComponentInit args)
Parameters
Type Name Description
EntityUid uid
VendingMachineComponent component
ComponentInit args
| Improve this Doc View Source

SetShooting(EntityUid, Boolean, VendingMachineComponent)

Sets the CanShoot property of the vending machine.

Declaration
public void SetShooting(EntityUid uid, bool canShoot, VendingMachineComponent component = null)
Parameters
Type Name Description
EntityUid uid
System.Boolean canShoot
VendingMachineComponent component
| Improve this Doc View Source

TryEjectVendorItem(EntityUid, InventoryType, String, Boolean, VendingMachineComponent)

Tries to eject the provided item. Will do nothing if the vending machine is incapable of ejecting, already ejecting or the item doesn't exist in its inventory.

Declaration
public void TryEjectVendorItem(EntityUid uid, InventoryType type, string itemId, bool throwItem, VendingMachineComponent vendComponent = null)
Parameters
Type Name Description
EntityUid uid
InventoryType type

The type of inventory the item is from

System.String itemId

The prototype ID of the item

System.Boolean throwItem

Whether the item should be thrown in a random direction after ejection

VendingMachineComponent vendComponent
| Improve this Doc View Source

TryRestockInventory(EntityUid, VendingMachineComponent)

Declaration
public void TryRestockInventory(EntityUid uid, VendingMachineComponent vendComponent = null)
Parameters
Type Name Description
EntityUid uid
VendingMachineComponent vendComponent
| Improve this Doc View Source

TryUpdateVisualState(EntityUid, VendingMachineComponent)

Tries to update the visuals of the component based on its current state.

Declaration
public void TryUpdateVisualState(EntityUid uid, VendingMachineComponent vendComponent = null)
Parameters
Type Name Description
EntityUid uid
VendingMachineComponent vendComponent
| Improve this Doc View Source

Update(Single)

Declaration
public override void Update(float frameTime)
Parameters
Type Name Description
System.Single frameTime
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾