Table of Contents

Class BossDataSource

Namespace
RisingV.BossDrops.Database
Assembly
RisingV.BossDrops.dll

Data source for BossData.

public class BossDataSource : FileDataSource<int, BossData, BossDataLoader>, IDataSource<int, BossData, BossDataLoader>, IDataSource<int, BossData>, IDataSource, IDataCrud, IDataCrud<int, BossData>
Inheritance
BossDataSource
Implements
Inherited Members
Extension Methods

Constructors

BossDataSource()

Data source for BossData.

public BossDataSource()

Properties

KeyResolver

Key resolver function to resolve keys from data items.

public override Func<BossData, int>? KeyResolver { get; set; }

Property Value

Func<BossData, int>

Log

protected override Logger Log { get; }

Property Value

Logger

Methods

Add(BossData)

public override int Add(BossData bossData)

Parameters

bossData BossData

Returns

int

Add(int, BossData)

public override void Add(int prefabGuid, BossData bossData)

Parameters

prefabGuid int
bossData BossData

Get(PrefabGUID)

Gets a boss by its Prefab GUID.

public BossData? Get(PrefabGUID prefabGuid)

Parameters

prefabGuid PrefabGUID

The Prefab GUID of the boss to retrieve.

Returns

BossData

The BossData if found; otherwise, null.

GetByEntity(Entity)

Gets a boss by its Entity.

public BossData? GetByEntity(Entity entity)

Parameters

entity Entity

The Entity of the boss to retrieve.

Returns

BossData

The BossData if found; otherwise, null.

Exceptions

DatabaseException

Thrown when the Entity is null.

GetByName(string)

Gets a boss by its name.

public BossData? GetByName(string name)

Parameters

name string

The name of the boss to retrieve.

Returns

BossData

The BossData if found; otherwise, null.

Initialize(IDatabase<int, BossData>)

public override void Initialize(IDatabase<int, BossData> database)

Parameters

database IDatabase<int, BossData>

Load(IDatabase<int, BossData>, BossDataLoader)

public override void Load(IDatabase<int, BossData> database, BossDataLoader loader)

Parameters

database IDatabase<int, BossData>
loader BossDataLoader

LoadItemDropIds(List<ItemDropData>)

Loads item drop IDs for the given list of item drops.

protected void LoadItemDropIds(List<ItemDropData> itemDrops)

Parameters

itemDrops List<ItemDropData>

The list of item drops to process.

LoadItemDropTemplates(ItemDropTemplateDatabase, List<ItemDropData>)

Loads item drop templates for the given list of item drops using the provided template database.

protected void LoadItemDropTemplates(ItemDropTemplateDatabase templateDatabase, List<ItemDropData> itemDrops)

Parameters

templateDatabase ItemDropTemplateDatabase

The database containing item drop templates.

itemDrops List<ItemDropData>

The list of item drops to process.

Ready(IDatabase<int, BossData>)

public override void Ready(IDatabase<int, BossData> database)

Parameters

database IDatabase<int, BossData>

RemoveByName(string)

Removes a boss by its name.

public BossData? RemoveByName(string name)

Parameters

name string

The name of the boss to remove.

Returns

BossData

The removed BossData if found; otherwise, null.

TryGetByEntity(Entity)

Attempts to get a boss by its Entity.

public BossData? TryGetByEntity(Entity entity)

Parameters

entity Entity

The Entity of the boss to retrieve.

Returns

BossData

The BossData if found; otherwise, null.

TryLoadItemTemplateData()

Attempts to load item drop template data for bosses.

public bool TryLoadItemTemplateData()

Returns

bool

True if item drop templates were successfully loaded, false otherwise.

Unload(IDatabase<int, BossData>)

public override void Unload(IDatabase<int, BossData> database)

Parameters

database IDatabase<int, BossData>