diff options
author | Clyne Sullivan <clyne@clyne-lp.example.com> | 2015-09-17 09:22:45 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@clyne-lp.example.com> | 2015-09-17 09:22:45 -0400 |
commit | c38029fa3d4fd7488c2bd9236eec86aff4448314 (patch) | |
tree | 2807889557cbc0c5391181c3556e4978eaa9549a /src/Quest.cpp | |
parent | 334ee89484336412d39e509c2594dee8f47c22ad (diff) |
shit
Diffstat (limited to 'src/Quest.cpp')
-rw-r--r-- | src/Quest.cpp | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/src/Quest.cpp b/src/Quest.cpp deleted file mode 100644 index a42e42c..0000000 --- a/src/Quest.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include <Quest.h>
-
-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(;i<TOTAL_QUESTS;i++){
- if(!strcmp(QuestList[i].title,t)){
- current[ccnt++]=&QuestList[i];
- return ccnt;
- }
- }
- return -1;
-}
-int QuestHandler::drop(const char *t){
- unsigned char i=0;
- for(;i<ccnt;i++){
- if(!strcmp(current[i]->title,t)){
- for(i++;i<ccnt;i++){
- current[i-1]=current[i];
- }
- return (--ccnt);
- }
- }
- return -1;
-}
-int QuestHandler::finish(const char *t){
- unsigned char i=0;
- unsigned int j;
- for(;i<ccnt;i++){
- if(!strcmp(current[i]->title,t)){
- j=current[i]->xp;
- for(i++;i<ccnt;i++){
- current[i-1]=current[i];
- }
- ccnt--;
- return j;
- }
- }
- return -1;
-}
|