Questie

Questie

116M Downloads

TODO: Would QueryQuestSingle() be better than used GetQuest() ?

Laumesis opened this issue ยท 0 comments

commented

Think / Test if QueryQuestSingle( ) would be more efficient than GetQuest( ).
Currently these are used mixedly. Some places Query database, some Get/Generate quest object.

Examples, but in general whole codebase:

function QuestieDB:IsPreQuestGroupFulfilled(preQuestGroup) :

local preQuest = QuestieDB:GetQuest(preQuestId);

function QuestieDB:IsPreQuestSingleFulfilled(preQuestSingle):

local preQuestExclusiveQuestGroup = QuestieDB.QueryQuestSingle(preQuestId, "exclusiveTo")

function QO:IsPreQuestSingleFulfilled() :

local preQuest = QuestieDB:GetQuest(preQuestId);

function QO:IsPreQuestGroupFulfilled() :

local preQuest = QuestieDB:GetQuest(preQuestId);

pros for QueryQuestSingle( ):
Less quests cached in _QuestieDB.questCache[questId] which can grow to huge?
Creating object to above cache is realitevely heavy?

pros for GetQuest( ) :
Quests get cached into _QuestieDB.questCache[questId] where from getting the data is faster than querying & decompressing from database.