Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 1, 2008, 8:32:10 PM (17 years ago)
Author:
landauf
Message:
  • adopted quest classes to the new hierarchy (with a creator pointer)
  • added "RegisterObject(…)" in all constructors and "virtual" to all destructors
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/quest/Quest.cc

    r2091 r2092  
    3434namespace orxonox {
    3535
    36     Quest::Quest() : QuestItem()
    37     {
     36    Quest::Quest(BaseObject* creator) : QuestItem(creator)
     37    {
     38        RegisterObject(Quest);
     39
    3840        this->initialize();
    3941    }
    40    
     42
    4143    /**
    4244    @brief
     
    4547    Quest::~Quest()
    4648    {
    47        
    48     }
    49    
     49
     50    }
     51
    5052    void Quest::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5153    {
    5254        SUPER(Quest, XMLPort, xmlelement, mode);
    53        
     55
    5456        XMLPortObject(Quest, Quest, "", addSubQuest, getSubQuests, xmlelement, mode);
    5557        XMLPortObject(Quest, QuestHint, "", addHint, getHints, xmlelement, mode);
    5658        XMLPortObject(Quest, QuestEffect, "fail-effects", addFailEffect, getFailEffects, xmlelement, mode);
    5759        XMLPortObject(Quest, QuestEffect, "complete-effects", addCompleteEffect, getCompleteEffects, xmlelement, mode);
    58        
     60
    5961        QuestManager::registerQuest(this); //Registers the quest with the QuestManager.
    6062    }
    61    
     63
    6264    /**
    6365    @brief
     
    6769    {
    6870        RegisterObject(Quest);
    69        
     71
    7072        this->parentQuest_ = NULL;
    7173    }
     
    8688            return false;
    8789        }
    88        
     90
    8991        this->parentQuest_ = quest;
    90        
     92
    9193        COUT(3) << "Parent Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
    9294        return true;
    9395    }
    94    
     96
    9597    /**
    9698    @brief
     
    108110            return false;
    109111        }
    110        
     112
    111113        quest->setParentQuest(this);
    112114        this->subQuests_.push_back(quest);
    113        
     115
    114116        COUT(3) << "Sub Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
    115117        return true;
    116118    }
    117    
    118    
    119     /**
    120     @brief
    121         Adds a Hint to the list of hints 
     119
     120
     121    /**
     122    @brief
     123        Adds a Hint to the list of hints
    122124    @param hint
    123125        The hint that should be added to the list of hints.
     
    132134            return false;
    133135        }
    134        
     136
    135137        this->hints_.push_back(hint);
    136138        hint->setQuest(this);
    137        
     139
    138140        COUT(3) << "QuestHint {" << hint->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
    139141        return true;
    140142    }
    141    
    142     /**
    143     @brief
    144        
     143
     144    /**
     145    @brief
     146
    145147    */
    146148    bool Quest::addFailEffect(QuestEffect* effect)
     
    151153            return false;
    152154        }
    153        
     155
    154156        this->failEffects_.push_back(effect);
    155        
     157
    156158        COUT(3) << "A FailEffect was added to Quest {" << this->getId() << "}." << std::endl;
    157159        return true;
    158160    }
    159    
    160     /**
    161     @brief
    162        
     161
     162    /**
     163    @brief
     164
    163165    */
    164166    bool Quest::addCompleteEffect(QuestEffect* effect)
     
    169171            return false;
    170172        }
    171        
     173
    172174        this->completeEffects_.push_back(effect);
    173        
     175
    174176        COUT(3) << "A CompleteEffect was added to Quest {" << this->getId() << "}." << std::endl;
    175177        return true;
    176178    }
    177    
    178     /**
    179     @brief
    180        
     179
     180    /**
     181    @brief
     182
    181183    */
    182184    const Quest* Quest::getParentQuest(void)
     
    184186        return this->parentQuest_;
    185187    }
    186    
    187     /**
    188     @brief
    189        
     188
     189    /**
     190    @brief
     191
    190192    */
    191193    const Quest* Quest::getSubQuests(unsigned int index) const
     
    202204        return NULL;
    203205    }
    204    
    205     /**
    206     @brief
    207        
     206
     207    /**
     208    @brief
     209
    208210    */
    209211    const QuestHint* Quest::getHints(unsigned int index) const
     
    220222        return NULL;
    221223    }
    222    
    223     /**
    224     @brief
    225        
     224
     225    /**
     226    @brief
     227
    226228    */
    227229    const QuestEffect* Quest::getFailEffects(unsigned int index) const
     
    238240        return NULL;
    239241    }
    240    
    241     /**
    242     @brief
    243        
     242
     243    /**
     244    @brief
     245
    244246    */
    245247    const QuestEffect* Quest::getCompleteEffects(unsigned int index) const
     
    256258        return NULL;
    257259    }
    258    
     260
    259261    /**
    260262    @brief
     
    271273        return this->getStatus(player) == questStatus::inactive;
    272274    }
    273    
     275
    274276    /**
    275277    @brief
     
    287289        return this->getStatus(player) == questStatus::active;
    288290    }
    289    
     291
    290292    /**
    291293    @brief
     
    302304        return this->getStatus(player) == questStatus::failed;
    303305    }
    304    
     306
    305307    /**
    306308    @brief
     
    317319        return this->getStatus(player) == questStatus::completed;
    318320    }
    319    
     321
    320322    /**
    321323    @brief
     
    336338        return false;
    337339    }
    338    
     340
    339341    /**
    340342    @brief
     
    356358        return false;
    357359    }
    358    
     360
    359361    /**
    360362    @brief
Note: See TracChangeset for help on using the changeset viewer.