| 1 | |
|---|
| 2 | |
|---|
| 3 | /* |
|---|
| 4 | orxonox - the future of 3D-vertical-scrollers |
|---|
| 5 | |
|---|
| 6 | Copyright (C) 2004 orx |
|---|
| 7 | |
|---|
| 8 | This program is free software; you can redistribute it and/or modify |
|---|
| 9 | it under the terms of the GNU General Public License as published by |
|---|
| 10 | the Free Software Foundation; either version 2, or (at your option) |
|---|
| 11 | any later version. |
|---|
| 12 | |
|---|
| 13 | ### File Specific: |
|---|
| 14 | main-programmer: Andreas Hejj |
|---|
| 15 | |
|---|
| 16 | */ |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY |
|---|
| 20 | |
|---|
| 21 | #include "debug.h" |
|---|
| 22 | #include "quest.h" |
|---|
| 23 | |
|---|
| 24 | #include "util/loading/load_param.h" |
|---|
| 25 | #include "util/loading/factory.h" |
|---|
| 26 | |
|---|
| 27 | #include "glgui.h" |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | ObjectListDefinition(Quest); |
|---|
| 34 | |
|---|
| 35 | Quest::Quest(const TiXmlElement* root) |
|---|
| 36 | { |
|---|
| 37 | this->registerObject(this, Quest::_objectList); |
|---|
| 38 | |
|---|
| 39 | this->status = false; |
|---|
| 40 | |
|---|
| 41 | if( root != NULL) |
|---|
| 42 | this->loadParams(root); |
|---|
| 43 | |
|---|
| 44 | } |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | /** |
|---|
| 48 | * deconstructor |
|---|
| 49 | */ |
|---|
| 50 | Quest::~Quest () |
|---|
| 51 | { |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | /** |
|---|
| 58 | * loads the xml tagsthis->questDescription |
|---|
| 59 | * @param root: root xml tag for this element |
|---|
| 60 | */ |
|---|
| 61 | |
|---|
| 62 | void Quest::loadParams(const TiXmlElement* root) |
|---|
| 63 | { |
|---|
| 64 | LoadParam(root, "quest-name", this, Quest, setQuestName) |
|---|
| 65 | .describe("sets the name of a quest"); |
|---|
| 66 | LoadParam(root, "quest-description", this, Quest, setQuestDescription) |
|---|
| 67 | .describe("sets the description of a quest"); |
|---|
| 68 | LoadParam(root, "quest-picture", this, Quest, setQuestPicture) |
|---|
| 69 | .describe("sets the picture of a quest"); |
|---|
| 70 | LoadParam(root, "quest-difficulty", this, Quest, setQuestDifficulty) |
|---|
| 71 | .describe("sets the difficulty of a quest"); |
|---|
| 72 | LoadParam(root, "quest-persons", this, Quest, setQuestPersons) |
|---|
| 73 | .describe("sets the number of persons needed for a quest"); |
|---|
| 74 | LoadParam(root, "reward-description", this, Quest, setRewardDescription) |
|---|
| 75 | .describe("sets the description of a reward"); |
|---|
| 76 | LoadParam(root, "reward-picture", this, Quest, setRewardPicture) |
|---|
| 77 | .describe("sets the Picture of a reward"); |
|---|
| 78 | |
|---|
| 79 | } |
|---|
| 80 | |
|---|
| 81 | void Quest::setQuestActive() |
|---|
| 82 | { |
|---|
| 83 | this->status = true; |
|---|
| 84 | } |
|---|
| 85 | |
|---|
| 86 | void Quest::setQuestInactive() |
|---|
| 87 | { |
|---|
| 88 | this->status = false; |
|---|
| 89 | } |
|---|