Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 23, 2008, 10:40:38 PM (16 years ago)
Author:
rgrieder
Message:

merged revisions 2260 - 2508 from trunk to buggy.
I'm sorry that I have to commit every merge. But otherwise I get tons of conflicts I have to solve ten times over.
Note: did not merge deletion of src/util/testing, tortoise wasn't very friendly with that.

Location:
code/branches/bugger
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/bugger

  • code/branches/bugger/src/orxonox/objects/quest/CompleteQuest.cc

    r2105 r2530  
    2626 *
    2727 */
     28 
     29/**
     30    @file CompleteQuest.cc
     31    @brief
     32    Implementation of the CompleteQuest class.
     33*/
    2834
    2935#include "OrxonoxStableHeaders.h"
     
    3339#include "util/Exception.h"
    3440
     41#include "orxonox/objects/infos/PlayerInfo.h"
    3542#include "QuestManager.h"
    3643#include "Quest.h"
     
    4047    CreateFactory(CompleteQuest);
    4148
     49    /**
     50    @brief
     51        Constructor. Registers the object.
     52    */
    4253    CompleteQuest::CompleteQuest(BaseObject* creator) : ChangeQuestStatus(creator)
    4354    {
     
    5364    }
    5465
     66    /**
     67    @brief
     68        Method for creating a CompleteQuest object through XML.
     69    */
    5570    void CompleteQuest::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5671    {
    5772        SUPER(CompleteQuest, XMLPort, xmlelement, mode);
     73       
     74        COUT(3) << "New CompleteQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
    5875    }
    5976
    6077    /**
    6178    @brief
    62         Invokes the effect.
     79        Invokes the QuestEffect.
    6380    @param player
    64         The player the effect is invoked on.
     81        The player the QuestEffect is invoked on.
    6582    @return
    66         Returns true if the effect was invoked successfully.
     83        Returns true if the QuestEffect was invoked successfully.
    6784    */
    68     bool CompleteQuest::invoke(Player* player)
     85    bool CompleteQuest::invoke(PlayerInfo* player)
    6986    {
    70         if(player == NULL)
     87        if(player == NULL) //!< You know, what we think of NULL-pointers...
    7188        {
    7289            COUT(2) << "Input player is NULL." << std::endl;
     
    7491        }
    7592
     93        COUT(3) << "CompleteQuest on player: " << player << " ." << std::endl;
     94
     95        Quest* quest;
     96
    7697        try
    7798        {
    78             Quest* quest = QuestManager::findQuest(this->getQuestId());
    79             if(!quest->complete(player))
     99            quest = QuestManager::findQuest(this->getQuestId());
     100            if(quest == NULL || !quest->complete(player))
    80101            {
    81102               return false;
     
    88109        }
    89110
     111        COUT(3) << "Quest {" << quest->getId() << "} successfully completed by player: " << player << " ." << std::endl;
    90112        return true;
    91113    }
Note: See TracChangeset for help on using the changeset viewer.