Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 12, 2016, 3:16:38 PM (8 years ago)
Author:
dmoritz
Message:

Final changes.

Location:
code/branches/Dialog_HS16/src/modules/notifications/dispatchers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.cc

    r11317 r11331  
    1 
    2 
    31
    42#include "Dialogue.h"
     
    1513        RegisterClass(Dialogue);
    1614
     15    /**
     16    @brief
     17        Default Constructor. Registers the object and initializes variables.
     18    */
    1719        Dialogue::Dialogue(Context* context):NotificationDispatcher(context){
    1820                RegisterObject(Dialogue);
     
    2224        this->setSyncMode(ObjectDirection::None);
    2325        }
    24 
     26    /**
     27    @brief
     28        Destructor.
     29    */
    2530        Dialogue::~Dialogue()
    2631    {
    2732
    2833    }
     34    /**
     35    @brief
     36        Method for creating a Dialogue object through XML.
     37    */
    2938    void Dialogue::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    3039    {
     
    3645       
    3746    }
    38      void Dialogue::update()
    39    {   
     47    /**
     48    @brief
     49        Passes the name of the picture over to the HUDDialogue class
     50    */
     51    void Dialogue::update()
     52    {   
    4053       for(HUDDialogue* huddialogue : ObjectList<HUDDialogue>())
    4154                       huddialogue->updateTarget(portrait_);
    4255    }
    43    
     56    /**
     57        @brief Creates the notification message,Pconsisting of a speaker and a message, that should be sent upon the Dialgue triggering.
     58        @return Returns the notification message.
     59    */
    4460    const std::string& Dialogue::createNotificationMessage(void)
    4561                {       
  • code/branches/Dialog_HS16/src/modules/notifications/dispatchers/Dialogue.h

    r11317 r11331  
    1111namespace orxonox{
    1212
     13        /**
     14    @brief
     15        The Dialogue class enables the sending of (in XML) predefined Notifications upon some kind of triggering event.
     16
     17        In use it would like this:
     18        @code
     19        <Dialogue message="some message..." speaker="speaker" portrait="Orxonox/some_file">
     20            <events>
     21                <trigger>
     22                    <PlayerTrigger />
     23                </trigger>
     24            </events>
     25        </Dialogue>
     26        @endcode
     27        For more information on what can be used for @code <PlayerTrigger /> @endcode see the @ref orxonox::NotificationDispatcher "NotificationDispatcher" documentation.
     28                For more information about the Dialogue class take a look at the Notifications entry in the wiki.
     29                */
     30
    1331class _NotificationsExport Dialogue: public NotificationDispatcher{
    1432
     
    1735            virtual ~Dialogue(); //!< Destructor.
    1836
    19             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     37            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Dialogue object through XML.
    2038
     39            /**
     40            @brief Get the message, that is displayed.
     41            @return Returns the message, that is displayed.
     42            */
    2143            const std::string& getMessage(void)
    2244                        { return this->message_; }
     45            /**
     46            @brief Get the name of the speaker.
     47            @return Returns the name of the speaker.
     48            */
    2349                const std::string& getSpeaker(void)
    2450                        {return this->speaker_;}
     51            /**
     52            @brief Get the name of the file of the picture
     53            @return Returns the name of the file.
     54            */
    2555            const std::string& getPortrait(void)
    2656                        { return this->portrait_;}
    2757
    2858    protected:
     59        /**
     60            @brief Creates the notification message that should be sent upon the Dialgue triggering.
     61            @return Returns the notification message.
     62            */
    2963        virtual const std::string& createNotificationMessage(void);
     64        /**
     65                @brief Updates the picture that is displayed by passing the name of the picture over to the HUDDialogue class.
     66                */
    3067        virtual void update(void);
    3168       
    3269    private:
    33                 std::string message_;
    34                 std::string speaker_;
    35                 std::string dialogue_;
    36                 std::string portrait_;
     70                std::string message_; //!< The message.
     71                std::string speaker_; //!< The name of the speaker.
     72                std::string dialogue_; //!< The speaker and the message that is displayed.
     73                std::string portrait_; //!< The name of the file.
    3774
     75                /**
     76                @brief Sets the name of the speaker.
     77                @param speaker The name of the speaker.
     78                */
    3879                void setSpeaker(const std::string& speaker)
    3980                { this->speaker_ = speaker;}
     81            /**
     82            @brief Sets the message that is to be displayed.
     83            @param message The message to be displayed.
     84            */
    4085                void setMessage(const std::string& message)
    4186                { this->message_ = message; }
     87            /**
     88            @brief Sets the name of the file of the picture.
     89            @param portrait Name of the file which is used.
     90            */
    4291            void setPortrait(const std::string& portrait)
    4392                { this->portrait_ = portrait;}
Note: See TracChangeset for help on using the changeset viewer.