Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 25, 2008, 11:56:40 PM (15 years ago)
Author:
landauf
Message:

merged questsystem2 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/quest/AddQuest.cc

    r2105 r2261  
    2727 */
    2828
     29/**
     30    @file AddQuest.cc
     31    @brief
     32    Implementation of the AddQuest class.
     33*/
     34
    2935#include "OrxonoxStableHeaders.h"
    3036#include "AddQuest.h"
    3137
    3238#include <string>
     39
    3340#include "core/CoreIncludes.h"
    3441#include "util/Exception.h"
    3542
     43#include "orxonox/objects/infos/PlayerInfo.h"
    3644#include "QuestManager.h"
    3745#include "Quest.h"
     
    4149    CreateFactory(AddQuest);
    4250
    43 
     51    /**
     52    @brief
     53        Constructor. Registers the object.
     54    */
    4455    AddQuest::AddQuest(BaseObject* creator) : ChangeQuestStatus(creator)
    4556    {
     
    5566    }
    5667
     68    /**
     69    @brief
     70        Method for creating a AddQuest object through XML.
     71    */
    5772    void AddQuest::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5873    {
    5974        SUPER(AddQuest, XMLPort, xmlelement, mode);
    60 
     75       
     76        COUT(3) << "New AddQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;
    6177    }
    6278
    6379    /**
    6480    @brief
    65         Invokes the effect.
     81        Invokes the QuestEffect.
    6682    @param player
    67         The player the effect is invoked on.
     83        The player the QuestEffect is invoked on.
    6884    @return
    69         Returns true if the effect was successfully invoked.
     85        Returns true if the QuestEffect was successfully invoked.
    7086    */
    71     bool AddQuest::invoke(Player* player)
     87    bool AddQuest::invoke(PlayerInfo* player)
    7288    {
    73         if(player == NULL)
     89        if(player == NULL) //!< Null-pointers are badass.
    7490        {
    7591            COUT(2) << "Input player is NULL." << std::endl;
     
    7793        }
    7894
     95        COUT(3) << "AddQuest on player: " << player << " ." << std::endl;
     96
    7997        try
    8098        {
    8199            Quest* quest = QuestManager::findQuest(this->getQuestId());
    82             if(!quest->start(player))
     100            if(quest == NULL || !quest->start(player))
    83101            {
    84102               return false;
     
    91109        }
    92110
     111        COUT(3) << "Quest {" << this->getQuestId() << "} successfully added to player." << std::endl;
    93112        return true;
    94113    }
Note: See TracChangeset for help on using the changeset viewer.