Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7484 for code


Ignore:
Timestamp:
Sep 23, 2010, 1:00:42 PM (14 years ago)
Author:
dafrick
Message:

Doing some documentation.

Location:
code/trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/doc/api/Groups.dox

    r7456 r7484  
    336336    @section SampleQuest Sample quest
    337337    To get your head around all of this and see some of the things mentioned here in action you might want to check out the "The Tale of Princess Aeryn"-Quest (Levelfile: princessaeryn.oxw) in the level-folder.
    338 
     338*/
     339
     340/**
    339341    @defgroup QuestEffects Effects
    340342    @ingroup Questsystem
  • code/trunk/src/modules/notifications/Notification.cc

    r7474 r7484  
    5050        RegisterRootObject(Notification);
    5151        this->initialize();
    52         this->registerVariables();
    5352    }
    5453
     
    122121    bool Notification::setMessage(const std::string & message)
    123122    {
    124         if(this->isSent()) //!< The message cannot be changed if the message has already been sent.
     123        if(this->isSent()) // The message cannot be changed if the message has already been sent.
    125124            return false;
    126125        this->message_ = message;
  • code/trunk/src/modules/notifications/Notification.h

    r7474 r7484  
    4747    /**
    4848    @brief
    49         A Notification is a short message used to inform the player about something that just happened. A Notification can be sent from any part of orxonox and is then displayed in the proper NotificationQueue (depending on which senders the specific NotificationQueue accepts).
     49        A Notification is a short message used to inform the player about something that just happened. A Notification can be sent from any part of orxonox and is then displayed in the proper @ref orxonox::NotificationQueue "NotificationQueue" (depending on which senders the specific @ref orxonox::NotificationQueue "NotificationQueue" accepts).
    5050    @author
    5151        Damian 'Mozork' Frick
     
    8383            bool sent_; //!< Whether Notification has been sent, if so it cannot be changed.
    8484
    85             void initialize(void);
    86             void registerVariables(void);
     85            void initialize(void); //!< Registers the object and sets some default values.
    8786
    8887    };
  • code/trunk/src/modules/notifications/NotificationDispatcher.cc

    r7474 r7484  
    9393    }
    9494
     95    /**
     96    @brief
     97        Registers variables for synchronisation.
     98    */
    9599    void NotificationDispatcher::registerVariables(void)
    96100    {
     
    113117        else if(GameMode::isServer())
    114118        {
     119            //TODO: This may fail if the object has not been synchronized, yet.
    115120            callMemberNetworkFunction(NotificationDispatcher, dispatch, this->getObjectID(), clientId, clientId);
    116121        }
  • code/trunk/src/modules/notifications/NotificationDispatcher.h

    r7474 r7484  
    4747    /**
    4848    @brief
    49         A NotificationDispatcher is an entity that, upon being triggered, dispatches (or sends) a specified Notification.
     49        A NotificationDispatcher is an entity that, upon being triggered, dispatches (or sends) a specified @ref orxonox::Notification "Notification".
     50
     51        Its standard usage is:
     52        @code
     53        <NotificationDispatcher>
     54            <events>
     55                <trigger>
     56                    <PlayerTrigger />
     57                </trigger>
     58            </event>
     59        </NotificationDispatcher>
     60        @endcode
     61        But keep in mind, that NotificationDispatcher is an abstract class and in this example @ref orxonox::PlayerTrigger "PlayerTrigger" stands for any event that is caused by a @ref orxonox::PlayerTrigger "PlayerTrigger", so instead of @ref orxonox::PlayerTrigger "PlayerTrigger", there could be a @ref orxonox::DistanceTrigger "DistanceTrigger", or a @ref orxonox::DistanceMultiTrigger "DistanceMutliTrigger", or even an @ref orxonox::EventListener "EventListener" that waits for an event coming from any kind of @ref orxonox::PlayerTrigger "PlayerTrigger".
    5062    @author
    5163        Damian 'Mozork' Frick
     
    7385            std::string sender_; //!< The name of the sender of the Notification dispatched by this NotificationDispatcher.
    7486
    75            void registerVariables(void);
     87            void registerVariables(void); //!< Register some variables for synchronisation.
    7688
    7789            /**
  • code/trunk/src/modules/notifications/NotificationManager.cc

    r7474 r7484  
    6060    ManageScopedSingleton(NotificationManager, ScopeID::Graphics, false);
    6161
     62    // Setting console command to enter the edit mode.
    6263    SetConsoleCommand("enterEditMode", &NotificationManager::enterEditMode);
    6364
     
    106107    }
    107108
     109    /**
     110    @brief
     111        Sends a Notification with the specified message to the specified client from the specified sender.
     112    @param message
     113        The message that should be sent.
     114    @param clientId
     115        The id of the client the notification should be sent to.
     116    @param sender
     117        The sender that sent the notification.
     118    */
    108119    /*static*/ void NotificationManager::sendNotification(const std::string& message, unsigned int clientId, const std::string& sender)
    109120    {
     121        // If we're in standalone mode or we're already no the right client we create and send the Notification.
    110122        if(GameMode::isStandalone() || Host::getPlayerID() == clientId)
    111123        {
     
    113125            notification->send(sender);
    114126        }
     127        // If we're on the server (and the server is not the intended recipient of the Notification) we send it over the network.
    115128        else if(GameMode::isServer())
    116129        {
  • code/trunk/src/modules/notifications/NotificationManager.h

    r7474 r7484  
    5050    /**
    5151    @brief
    52         The Singleton NotificationManager functions as a gateway between Notifications and NotificationListeners.
    53         It receives, organizes Notifications and the redistributes them to the specific NotificationListeners.
     52        The Singleton NotificationManager functions as a gateway between @ref orxonox::Notification "Notifications" and @ref orxonox::NotificationListener "NotificationListeners".
     53        It receives, organizes @ref orxonox::Notification "Notifications" and the redistributes them to the specific @ref orxonox::NotificationListener "NotificationListeners".
     54        It also provides a static function to send @ref orxonox::Notification "Notifications" and works as a liaison between the @ref orxonox>>NotificationQueue "NotificationQueues" and the GUI that displays notification, called NotificationLayer.
    5455    @author
    5556        Damian 'Mozork' Frick
     
    6566            virtual void preDestroy(void); //!< Is called before the object is destroyed.
    6667
     68            /**
     69            @brief Get the instance of the NotificationManager Singleton.
     70            @return Returns a reference to the NotificationManager.
     71            */
    6772            static NotificationManager& getInstance() { return Singleton<NotificationManager>::getInstance(); } // tolua_export
    6873
     
    7075            static const std::string NONE; //!< Static string to indicare a sender that sends to no specific NotificationListener.
    7176
     77            //! Sends a Notification with the specified message to the specified client from the specified sender.
    7278            static void sendNotification(const std::string& message, unsigned int clientId, const std::string& sender = NotificationManager::NONE);
    7379
  • code/trunk/src/modules/notifications/NotificationQueue.cc

    r7417 r7484  
    5252        Constructor. Creates and initializes the object.
    5353    @param name
    54         The name of the new NotificationQueue.
     54        The name of the new NotificationQueue. It needs to be unique
    5555    @param senders
    5656        The senders that are targets of this NotificationQueue, i.e. the names of senders whose Notifications this NotificationQueue displays.
  • code/trunk/src/modules/notifications/NotificationQueue.h

    r7456 r7484  
    5454    struct NotificationContainer
    5555    {
    56         Notification* notification; //!< The Notification displayed.
    57         time_t time; //!< The time the Notification was sent and thus first displayed.
     56        Notification* notification; // The Notification displayed.
     57        time_t time; // The time the Notification was sent and thus first displayed.
    5858    };
    5959
     
    6161    struct NotificationContainerCompare {
    6262        bool operator() (const NotificationContainer* const & a, const NotificationContainer* const & b) const
    63             { return a->time < b->time; } //!< Ordered by time.
     63            { return a->time < b->time; } // Ordered by time.
    6464    };
    6565
    6666    /**
    6767    @brief
    68         Displays Notifications from specific senders.
     68        Displays @ref orxonox::Notification "Notifications" from specific senders.
     69
     70        There are quite some parameters that influence the behaviour of the NotificationQueue:
     71        - 'name': The name of the NotificationQueue. It needs to be unique.
     72        - 'senders': The senders that are targets of this NotificationQueue, i.e. the names of senders whose Notifications this NotificationQueue displays.
     73        - 'size': The size of the NotificationQueue, it specifies how many @ref orxonox::Notification "Notifications" are displayed at once at the most.
     74        - 'displayTime': The time a @ref orxonox::Notification "Notification" is displayed with this NotificationQueue.
    6975    @author
    7076        Damian 'Mozork' Frick
  • code/trunk/src/modules/notifications/dispatchers/CommandNotification.cc

    r7474 r7484  
    8080    }
    8181
     82    /**
     83    @brief
     84        Register some variables for synchronisation.
     85    */
    8286    void CommandNotification::registerVariables(void)
    8387    {
  • code/trunk/src/modules/notifications/dispatchers/CommandNotification.h

    r7474 r7484  
    4747        This class implements a method of displaying a Notification with information to an input command and the key the command is mapped to.
    4848        The message that is displayed is a string made out uf the concatenation of the preMessage, the key the specified command is mapped to and the postMessage.
     49
     50        In use it would like this:
     51        @code
     52        <CommandNotification preMessage="Please press " command="someCommand" postMessage=" to do something." >
     53            <events>
     54                <trigger>
     55                    <PlayerTrigger />
     56                </trigger>
     57            </events>
     58        </CommandNotification>
     59        @endcode
     60        Upon being triggered this would display the @ref orxonox::Notification "Notification" "Please press {the binding of the specified command} to do something".
     61        For more information on what can be used for @code <PlayerTrigger /> @endcode see the @ref orxonox::NotificationDispatcher "NotificationDispatcher" documentation.
    4962    @author
    5063        Damian 'Mozork' Frick
     
    8699            std::string postMessage_; //!< The last part of the displayed message.
    87100
    88             void registerVariables(void);
     101            void registerVariables(void); //!< Register some variables for synchronisation.
    89102
    90103            /**
  • code/trunk/src/modules/notifications/dispatchers/SimpleNotification.h

    r7456 r7484  
    4646    @brief
    4747        The SimpleNotification class enables the sending of (in XML) predefined Notifications upon some kind of triggering event.
     48
     49        In use it would like this:
     50        @code
     51        <SimpleNotification message="some message..." >
     52            <events>
     53                <trigger>
     54                    <PlayerTrigger />
     55                </trigger>
     56            </events>
     57        </SimpleNotification>
     58        @endcode
     59        For more information on what can be used for @code <PlayerTrigger /> @endcode see the @ref orxonox::NotificationDispatcher "NotificationDispatcher" documentation.
    4860    @author
    4961        Damian 'Mozork' Frick
  • code/trunk/src/modules/objects/Script.h

    r7483 r7484  
    8181    @author
    8282        Benjamin Knecht
     83    @author
    8384        Damian 'Mozork' Frick
    8485    */
  • code/trunk/src/modules/questsystem/QuestEffectBeacon.cc

    r7456 r7484  
    5252        Constructor. Registers the object and initializes defaults.
    5353    */
    54     //TODO: Make just BaseObject?
    5554    QuestEffectBeacon::QuestEffectBeacon(BaseObject* creator) : StaticEntity(creator)
    5655    {
  • code/trunk/src/modules/questsystem/QuestManager.h

    r7456 r7484  
    5050    @brief
    5151        Is a Singleton and manages @ref orxonox::Quest "Quests", by registering every @ref orxonox::Quest "Quest" / @ref orxonox::QuestHint "QuestHint" (through registerX()) and making them globally accessible (through findX()).
    52         @ref orxonox::Quest "Quests" (and @ref orxonox::QuestHint 2) are registered in the QuestManager with their id, and can be accessed in the same way.
     52        @ref orxonox::Quest "Quests" (and @ref orxonox::QuestHint "QuestHints") are registered in the QuestManager with their id, and can be accessed in the same way.
    5353    @author
    5454        Damian 'Mozork' Frick
  • code/trunk/src/orxonox/interfaces/NotificationListener.h

    r7417 r7484  
    2828
    2929/**
    30     @file
     30    @file NotificationListener.h
    3131    @brief Definition of the NotificationListener class.
     32    @ingroup Notifications
    3233*/
    3334
     
    5253    @brief
    5354        NotificationListener interface.
     55
     56        The NotificationListener interface presents a means to being informed when @ref orxonox::Notification "Notifications" in the target set of this NotificationListener change. (e.g. @ref orxonox::Notification "Notifications" were added or removed)
     57        When inheriting from a NotificationListener it is important to register (in the constructor) and unregister (in the destructor) it to and from the @ref orxonox::NotificationManager "NotificationManager".
    5458    @author
    5559        Fabian 'x3n' Landau
    5660    */
     61    //TODO: Needed? Remove or move some NotificationQueue things over here.
    5762    class _OrxonoxExport NotificationListener : virtual public OrxonoxClass
    5863    {
     
    6166            virtual ~NotificationListener() {}
    6267
    63             virtual const std::set<std::string> & getTargetsSet() = 0;
     68            /**
     69            @brief Get the senders that are targets of this NotificationListener.
     70            @return Returns the set of senders that are targets of this NotificationListener.
     71            */
     72            virtual const std::set<std::string> & getTargetsSet(void) = 0;
     73
     74            /**
     75            @brief Updates the whole NotificationListener.
     76                   This is called by the @ref orxonox::NotificationManager "NotificationManager" when the @ref orxonox::Notification "Notifications" have changed so much, that the NotificationListener may have to re-initialize his operations.
     77            */
    6478            virtual void update(void) = 0;
     79            /**
     80            @brief Updates the NotificationListener, when a new Notification has come in at the specified time.
     81            @param notification A pointer to the @ref orxonox::Notification "Notification".
     82            @param time The time the @ref orxonox::Notification "Notification" has come in.
     83            */
    6584            virtual void update(Notification* notification, const std::time_t & time) = 0;
    6685    };
Note: See TracChangeset for help on using the changeset viewer.