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
bossDataBossData
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
prefabGuidPrefabGUIDThe Prefab GUID of the boss to retrieve.
Returns
GetByEntity(Entity)
Gets a boss by its Entity.
public BossData? GetByEntity(Entity entity)
Parameters
entityEntityThe 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
namestringThe 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
databaseIDatabase<int, BossData>loaderBossDataLoader
LoadItemDropIds(List<ItemDropData>)
Loads item drop IDs for the given list of item drops.
protected void LoadItemDropIds(List<ItemDropData> itemDrops)
Parameters
itemDropsList<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
templateDatabaseItemDropTemplateDatabaseThe database containing item drop templates.
itemDropsList<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
namestringThe name of the boss to remove.
Returns
TryGetByEntity(Entity)
Attempts to get a boss by its Entity.
public BossData? TryGetByEntity(Entity entity)
Parameters
entityEntityThe 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)