Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2081


Ignore:
Timestamp:
Nov 1, 2008, 11:00:46 AM (15 years ago)
Author:
dafrick
Message:

Ready for merge! (It won't compile after the merge, though ;) )

Location:
code/branches/questsystem/src/orxonox/objects
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem/src/orxonox/objects/AddQuestHint.cc

    r2076 r2081  
    3131
    3232#include "QuestManager.h"
     33#include "QuestItem.h"
    3334#include "AddQuestHint.h"
    3435
     
    5657        XMLPortParam(AddQuestHint, "hintId", setHintId, getHintId, xmlelement, mode);
    5758       
     59    }
     60
     61    inline void AddQuestHint::setHintId(const std::string & id)
     62    {
     63        if(!QuestItem::isId(id))
     64        {
     65            COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
     66            return;
     67        }
     68        this->hintId_ = id;
    5869    }
    5970
  • code/branches/questsystem/src/orxonox/objects/AddQuestHint.h

    r2076 r2081  
    5959            inline const std::string & getHintId(void) const
    6060                { return this->hintId_; }
    61             inline void setHintId(const std::string & id)
    62                 { this->hintId_ = id; }
     61            void setHintId(const std::string & id);
    6362   
    6463    };
  • code/branches/questsystem/src/orxonox/objects/ChangeQuestStatus.cc

    r2076 r2081  
    2929#include "core/CoreIncludes.h"
    3030
     31#include "QuestItem.h"
    3132#include "ChangeQuestStatus.h"
    3233
     
    4647    }
    4748   
     49    void ChangeQuestStatus::setQuestId(const std::string & id)
     50    {
     51        if(!QuestItem::isId(id))
     52        {
     53            COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
     54            return;
     55        }
     56        this->questId_ = id;
     57    }
     58   
    4859    void ChangeQuestStatus::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    4960    {
  • code/branches/questsystem/src/orxonox/objects/ChangeQuestStatus.h

    r2076 r2081  
    6262           
    6363        private:
    64             inline void setQuestId(const std::string & id)
    65                 { this->questId_ = id; }
     64            void setQuestId(const std::string & id);
    6665
    6766    };
  • code/branches/questsystem/src/orxonox/objects/GlobalQuest.cc

    r2076 r2081  
    5858        SUPER(GlobalQuest, XMLPort, xmlelement, mode);
    5959
    60         COUT(1) << "New GlobalQuest {" << this->getId() << "} created." << std::endl;
     60        COUT(3) << "New GlobalQuest {" << this->getId() << "} created." << std::endl;
    6161    }
    6262   
  • code/branches/questsystem/src/orxonox/objects/LocalQuest.cc

    r2076 r2081  
    5454        SUPER(LocalQuest, XMLPort, xmlelement, mode);
    5555
    56         COUT(1) << "New LocalQuest {" << this->getId() << "} created." << std::endl;
     56        COUT(3) << "New LocalQuest {" << this->getId() << "} created." << std::endl;
    5757    }
    5858   
  • code/branches/questsystem/src/orxonox/objects/Quest.cc

    r2076 r2081  
    8888       
    8989        this->parentQuest_ = quest;
     90       
     91        COUT(3) << "Parent Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
    9092        return true;
    9193    }
     
    109111        quest->setParentQuest(this);
    110112        this->subQuests_.push_back(quest);
     113       
     114        COUT(3) << "Sub Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
    111115        return true;
    112116    }
     
    131135        this->hints_.push_back(hint);
    132136        hint->setQuest(this);
     137       
     138        COUT(3) << "QuestHint {" << hint->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
    133139        return true;
    134140    }
     
    147153       
    148154        this->failEffects_.push_back(effect);
     155       
     156        COUT(3) << "A FailEffect was added to Quest {" << this->getId() << "}." << std::endl;
    149157        return true;
    150158    }
     
    163171       
    164172        this->completeEffects_.push_back(effect);
     173       
     174        COUT(3) << "A CompleteEffect was added to Quest {" << this->getId() << "}." << std::endl;
    165175        return true;
    166176    }
  • code/branches/questsystem/src/orxonox/objects/QuestDescription.cc

    r2076 r2081  
    5252        XMLPortParam(QuestDescription, "description", setDescription, getDescription, xmlelement, mode);
    5353       
    54         COUT(1) << "New QuestDescription with title '" << this->getTitle() << "' created." << std::endl;
     54        COUT(3) << "New QuestDescription with title '" << this->getTitle() << "' created." << std::endl;
    5555    }
    5656   
  • code/branches/questsystem/src/orxonox/objects/QuestHint.cc

    r2076 r2081  
    6464        SUPER(QuestHint, XMLPort, xmlelement, mode);
    6565       
    66         COUT(1) << "New QuestHint {" << this->getId() << "} created." << std::endl;
     66        COUT(3) << "New QuestHint {" << this->getId() << "} created." << std::endl;
    6767    }
    6868
  • code/branches/questsystem/src/orxonox/objects/QuestItem.cc

    r2076 r2081  
    7171    }
    7272   
     73    void QuestItem::setId(const std::string & id)
     74    {
     75        if(!isId(id))
     76        {
     77            COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
     78            return;
     79        }
     80        this->id_ = id;
     81    }
     82   
    7383    //const QuestDescription* QuestItem::getDescription(unsigned int index) const //!< Returns the description of the QuestItem.
    7484    //{
  • code/branches/questsystem/src/orxonox/objects/QuestItem.h

    r2076 r2081  
    6464           
    6565        protected:
    66             inline void setId(const std::string & id)
    67                 { id_ = id; }
     66            void setId(const std::string & id);
    6867            inline void setDescription(QuestDescription* description)
    6968                { this->description_ = description; }
Note: See TracChangeset for help on using the changeset viewer.