mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-25 16:58:08 +00:00
Add LoadValuesFromDefaults for CDClient tables used by ActivityComponent
Co-authored-by: aronwk-aaron <26027722+aronwk-aaron@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,17 @@
|
||||
#include "CDActivityRewardsTable.h"
|
||||
|
||||
namespace {
|
||||
// Default entries for fallback
|
||||
CDActivityRewards defaultEntry{
|
||||
.objectTemplate = 1,
|
||||
.ActivityRewardIndex = 1,
|
||||
.activityRating = 1,
|
||||
.LootMatrixIndex = 0,
|
||||
.CurrencyIndex = 1,
|
||||
.ChallengeRating = 1,
|
||||
.description = "Default test activity reward",
|
||||
};
|
||||
}
|
||||
|
||||
void CDActivityRewardsTable::LoadValuesFromDatabase() {
|
||||
|
||||
@@ -37,6 +49,12 @@ void CDActivityRewardsTable::LoadValuesFromDatabase() {
|
||||
tableData.finalize();
|
||||
}
|
||||
|
||||
void CDActivityRewardsTable::LoadValuesFromDefaults() {
|
||||
auto& entries = GetEntriesMutable();
|
||||
entries.clear();
|
||||
entries.push_back(defaultEntry);
|
||||
}
|
||||
|
||||
std::vector<CDActivityRewards> CDActivityRewardsTable::Query(std::function<bool(CDActivityRewards)> predicate) {
|
||||
|
||||
std::vector<CDActivityRewards> data = cpplinq::from(GetEntries())
|
||||
|
||||
Reference in New Issue
Block a user