Class BossDataSource
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
Log
protected override Logger Log { get; }
Property Value
Methods
Add(BossData)
public override int Add(BossData bossData)
Parameters
bossData
BossData
Returns
Add(int, BossData)
public override void Add(int prefabGuid, BossData bossData)
Parameters
Get(PrefabGUID)
Gets a boss by its Prefab GUID.
public BossData? Get(PrefabGUID prefabGuid)
Parameters
prefabGuid
PrefabGUIDThe Prefab GUID of the boss to retrieve.
Returns
GetByEntity(Entity)
Gets a boss by its Entity.
public BossData? GetByEntity(Entity entity)
Parameters
entity
EntityThe Entity of the boss to retrieve.
Returns
Exceptions
- DatabaseException
Thrown when the Entity is null.
GetByName(string)
Gets a boss by its name.
public BossData? GetByName(string name)
Parameters
name
stringThe name of the boss to retrieve.
Returns
Initialize(IDatabase<int, BossData>)
public override void Initialize(IDatabase<int, BossData> database)
Parameters
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
ItemDropTemplateDatabaseThe 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
RemoveByName(string)
Removes a boss by its name.
public BossData? RemoveByName(string name)
Parameters
name
stringThe name of the boss to remove.
Returns
TryGetByEntity(Entity)
Attempts to get a boss by its Entity.
public BossData? TryGetByEntity(Entity entity)
Parameters
entity
EntityThe Entity of the boss to retrieve.
Returns
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)