Table of Contents

Class BarricadeStateStore

Namespace
Uncreated.Warfare.FOBs.StateStorage
Assembly
Uncreated.Warfare.dll

A service for storing and fetching SDG.Unturned.BarricadeData states (byte arrays that contain information about its stored items) in yaml, so that a particular state can be loaded later.

public class BarricadeStateStore : ILayoutHostedService, IDisposable
Inheritance
BarricadeStateStore
Implements
Inherited Members

Constructors

BarricadeStateStore(WarfareModule, ILogger<BarricadeStateStore>)

public BarricadeStateStore(WarfareModule warfareModule, ILogger<BarricadeStateStore> logger)

Parameters

warfareModule WarfareModule
logger ILogger<BarricadeStateStore>

Properties

Spawns

List of all buildable save.

public IReadOnlyList<BarricadeStateSave> Spawns { get; }

Property Value

IReadOnlyList<BarricadeStateSave>

Remarks

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

FindBarricadeSave(ItemPlaceableAsset, FactionInfo?)

Find a barricade save from an asset an an optional faction. A faction match is prioritized over an unfiltered match.

public BarricadeStateSave? FindBarricadeSave(ItemPlaceableAsset matchingAsset, FactionInfo? matchingfactionInfo = null)

Parameters

matchingAsset ItemPlaceableAsset
matchingfactionInfo FactionInfo

Returns

BarricadeStateSave

RemoveAsync(BarricadeStateSave, CancellationToken)

Delete the given barricade save if it exists.

public UniTask<bool> RemoveAsync(BarricadeStateSave save, CancellationToken token = default)

Parameters

save BarricadeStateSave
token CancellationToken

Returns

UniTask<bool>

SaveAsync(ItemBarricadeAsset, byte[], FactionInfo?, CancellationToken)

Add a new barricade save or just save the list if it's already in the list.

public UniTask SaveAsync(ItemBarricadeAsset asset, byte[] state, FactionInfo? faction = null, CancellationToken token = default)

Parameters

asset ItemBarricadeAsset
state byte[]
faction FactionInfo
token CancellationToken

Returns

UniTask

SaveAsync(CancellationToken)

Save all barricade saves to disk.

public UniTask SaveAsync(CancellationToken token = default)

Parameters

token CancellationToken

Returns

UniTask