- Joined
- Jun 5, 2008
- Messages
- 2,573
A really simple library i wrote while i was bored and in a need of a better way to setup my quests that a hundred of native calls that are far too boring and slow human wise...
Anyway it is simple but unfinished and i need some feedback about this(and yes i know it has no documentation, that will be changed tomorrow when i update the code).
The only thing i haven't thought of is how to store the quests for future manipulations(marking them as completed,failed,etc) and i want to hear opinions on how to do this (hashtable is an option).
Anyway it is simple but unfinished and i need some feedback about this(and yes i know it has no documentation, that will be changed tomorrow when i update the code).
JASS:
library Quest
globals
private constant integer MAX_QUEST_REQ_SIZE = 10
endglobals
interface qInterface
boolean enabled
boolean completed
boolean failed
boolean discovered
boolean required
quest main
string title
string description
questitem array questItem [MAX_QUEST_REQ_SIZE]
string array questItemDes [MAX_QUEST_REQ_SIZE]
boolean array questItemComp [MAX_QUEST_REQ_SIZE]
string icon
endinterface
struct xquest extends qInterface
boolean enabled = true // by default
boolean discovered = true // by default
boolean required = true // by default
endstruct
function UpdateQuest takes xquest q returns nothing
local integer i = 0
call QuestSetEnabled(q.main,q.enabled)
call QuestSetTitle(q.main,q.title)
call QuestSetDescription(q.main,q.description)
call QuestSetIconPath(q.main,q.icon)
call QuestSetCompleted(q.main,q.completed)
call QuestSetRequired(q.main,q.required)
call QuestSetFailed(q.main,q.failed)
call QuestSetDiscovered(q.main,q.discovered)
loop
exitwhen i >= MAX_QUEST_REQ_SIZE
if q.questItem[i] != null then
call QuestItemSetDescription(q.questItem[i],q.questItemDes[i])
endif
set i = i +1
endloop
endfunction
endlibrary
The only thing i haven't thought of is how to store the quests for future manipulations(marking them as completed,failed,etc) and i want to hear opinions on how to do this (hashtable is an option).