Changeset 7355 for code/branches/notifications/src
- Timestamp:
- Sep 5, 2010, 1:29:07 PM (14 years ago)
- Location:
- code/branches/notifications/src/modules/questsystem
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/notifications/src/modules/questsystem/Quest.cc
r7163 r7355 367 367 COUT(4) << "Quest {" << this->getId() << "} is failed for player: " << player << " ." <<std::endl; 368 368 369 this->getDescription()->sendFailQuestNotification( );369 this->getDescription()->sendFailQuestNotification(player); 370 370 return true; 371 371 } … … 386 386 COUT(4) << "Quest {" << this->getId() << "} is completed for player: " << player << " ." <<std::endl; 387 387 388 this->getDescription()->sendCompleteQuestNotification( );388 this->getDescription()->sendCompleteQuestNotification(player); 389 389 return true; 390 390 } … … 412 412 this->setStatus(player, QuestStatus::Active); 413 413 414 this->getDescription()->sendAddQuestNotification( );414 this->getDescription()->sendAddQuestNotification(player); 415 415 return true; 416 416 } -
code/branches/notifications/src/modules/questsystem/QuestDescription.cc
r7163 r7355 84 84 @param status 85 85 The status the QuestDescription us for. 86 @param player 87 The player the Notification is sent to. 86 88 @return 87 89 Returns true if successful. 88 @todo89 Make sure the messages meet the conditions.90 90 */ 91 bool QuestDescription::notificationHelper(const std::string & item, const std::string & status )91 bool QuestDescription::notificationHelper(const std::string & item, const std::string & status, PlayerInfo* player) 92 92 { 93 93 std::string message; … … 123 123 124 124 QuestNotification* notification = new QuestNotification(this, message); 125 notification->send( );125 notification->send(player); 126 126 return true; 127 127 } -
code/branches/notifications/src/modules/questsystem/QuestDescription.h
r7163 r7355 95 95 /** 96 96 @brief Sends a Notification displaying that a QuestHint was added. 97 @param player The player the Notification is sent to. 97 98 @return Returns true if successful. 98 99 */ 99 inline bool sendAddHintNotification( void)100 { return notificationHelper("hint", "" ); }100 inline bool sendAddHintNotification(PlayerInfo* player) 101 { return notificationHelper("hint", "", player); } 101 102 102 103 /** 103 104 @brief Sends a Notification displaying that a Quest was added. 105 @param player The player the Notification is sent to. 104 106 @return Returns true if successful. 105 107 */ 106 inline bool sendAddQuestNotification( void)107 { return notificationHelper("quest", "start" ); }108 inline bool sendAddQuestNotification(PlayerInfo* player) 109 { return notificationHelper("quest", "start", player); } 108 110 109 111 /** 110 112 @brief Sends a Notification displaying that a Quest was failed. 113 @param player The player the Notification is sent to. 111 114 @return Returns true if successful. 112 115 */ 113 inline bool sendFailQuestNotification( void)114 { return notificationHelper("quest", "fail" ); }116 inline bool sendFailQuestNotification(PlayerInfo* player) 117 { return notificationHelper("quest", "fail", player); } 115 118 116 119 /** 117 120 @brief Sends a Notification displaying that a Quest was completed. 121 @param player The player the Notification is sent to. 118 122 @return Returns true if successful. 119 123 */ 120 inline bool sendCompleteQuestNotification( void)121 { return notificationHelper("quest", "complete" ); }124 inline bool sendCompleteQuestNotification(PlayerInfo* player) 125 { return notificationHelper("quest", "complete", player); } 122 126 123 127 private: … … 127 131 std::string completeMessage_; //!< The message displayed when the Quest is completed. 128 132 129 bool notificationHelper(const std::string & item, const std::string & status ); //!< Helper for sending QuestDescriptions as Notifications.133 bool notificationHelper(const std::string & item, const std::string & status, PlayerInfo* player); //!< Helper for sending QuestDescriptions as Notifications. 130 134 131 135 /** -
code/branches/notifications/src/modules/questsystem/QuestHint.cc
r7163 r7355 121 121 this->playerStatus_[player] = QuestHintStatus::Active; 122 122 123 this->getDescription()->sendAddHintNotification( );123 this->getDescription()->sendAddHintNotification(player); 124 124 return true; 125 125 } -
code/branches/notifications/src/modules/questsystem/QuestNotification.cc
r7324 r7355 29 29 #include "QuestNotification.h" 30 30 #include "core/CoreIncludes.h" 31 #include "infos/PlayerInfo.h" 31 32 32 33 namespace orxonox { … … 68 69 @brief 69 70 Send the QuestNotification. 71 @param player 72 The player the Notification is sent to. 70 73 @return 71 74 Returns true if successful. 72 75 */ 73 bool QuestNotification::send( void)76 bool QuestNotification::send(PlayerInfo* player) 74 77 { 75 return t rue;//this->Notification::send(QuestNotification::SENDER); //TODO: Adjust.78 return this->Notification::send(player->getClientID(), QuestNotification::SENDER); 76 79 } 77 80 -
code/branches/notifications/src/modules/questsystem/QuestNotification.h
r7163 r7355 50 50 virtual ~QuestNotification(); //!< Destructor. 51 51 52 bool send( void); //!< Send the QuestNotification.52 bool send(PlayerInfo* player); //!< Send the QuestNotification. 53 53 54 54 private:
Note: See TracChangeset
for help on using the changeset viewer.