From 3994d87991496a140edbb7d67ddbebb9f82f3061 Mon Sep 17 00:00:00 2001 From: drumsetmonkey Date: Wed, 30 Sep 2015 08:06:06 -0400 Subject: Added quest files and file for names --- src/Quest.cpp | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/Quest.cpp (limited to 'src/Quest.cpp') diff --git a/src/Quest.cpp b/src/Quest.cpp new file mode 100644 index 0000000..a42e42c --- /dev/null +++ b/src/Quest.cpp @@ -0,0 +1,62 @@ +#include + +const Quest QuestList[TOTAL_QUESTS]={ + Quest("Test","A test quest",0) +}; + +Quest::Quest(const char *t,const char *d,unsigned int x){ + size_t len; + title=(char *)malloc((len=strlen(t))); + strncpy(title,t,len); + desc=(char *)malloc((len=strlen(d))); + strncpy(desc,d,len); + xp=x; +} +Quest::~Quest(){ + free(title); + free(desc); + xp=0; +} + +QuestHandler::QuestHandler(){ + ccnt=0; +} +int QuestHandler::assign(const char *t){ + unsigned int i=0; + if(ccnt==QUEST_LIMIT) + return -1; + for(;ititle,t)){ + for(i++;ititle,t)){ + j=current[i]->xp; + for(i++;i