Table of Contents

Class BuildableAttributesDataStore

Namespace
Uncreated.Warfare.Buildables
Assembly
Uncreated.Warfare.dll

Stores a key-value-pair dictionary for each barricade and structure.

[Priority(11)]
public class BuildableAttributesDataStore : IHostedService, ILevelHostedService, IEventListener<IBuildableDestroyedEvent>
Inheritance
BuildableAttributesDataStore
Implements
Inherited Members

Constructors

BuildableAttributesDataStore(ILogger<BuildableAttributesDataStore>)

public BuildableAttributesDataStore(ILogger<BuildableAttributesDataStore> logger)

Parameters

logger ILogger<BuildableAttributesDataStore>

Methods

HasAttribute(uint, bool, string)

Check if a buildable contains an attribute.

public bool HasAttribute(uint instanceId, bool isStrucutre, string attribute)

Parameters

instanceId uint
isStrucutre bool
attribute string

Returns

bool

Exceptions

GameThreadException

HasAttribute(IBuildable, string)

Check if a buildable contains an attribute.

public bool HasAttribute(IBuildable buildable, string attribute)

Parameters

buildable IBuildable
attribute string

Returns

bool

Exceptions

GameThreadException

TryGetAttribute(uint, bool, string, out object?)

Get the value of a buildable attribute.

public bool TryGetAttribute(uint instanceId, bool isStrucutre, string attribute, out object? value)

Parameters

instanceId uint
isStrucutre bool
attribute string
value object

Returns

bool

Exceptions

GameThreadException

TryGetAttribute(IBuildable, string, out object?)

Get the value of a buildable attribute.

public bool TryGetAttribute(IBuildable buildable, string attribute, out object? value)

Parameters

buildable IBuildable
attribute string
value object

Returns

bool

Exceptions

GameThreadException

UpdateAttributes(uint, bool)

Start modifying the attributes of a buildable.

public IDictionary<string, object?> UpdateAttributes(uint instanceId, bool isStrucutre)

Parameters

instanceId uint
isStrucutre bool

Returns

IDictionary<string, object>

Exceptions

GameThreadException

UpdateAttributes(IBuildable)

Start modifying the attributes of a buildable.

public IDictionary<string, object?> UpdateAttributes(IBuildable buildable)

Parameters

buildable IBuildable

Returns

IDictionary<string, object>

Exceptions

GameThreadException