/* * ORXONOX - the hottest 3D action shooter ever to exist * > www.orxonox.net < * * * License notice: * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Author: * Damian 'Mozork' Frick * Co-authors: * ... * */ /** @file LocalQuest.h @brief Definition of the LocalQuest class. */ #ifndef _LocalQuest_H__ #define _LocalQuest_H__ #include "OrxonoxPrereqs.h" #include #include #include "core/XMLPort.h" #include "Quest.h" namespace orxonox { /** @brief Handles Quests which have different states for different players. LocalQuests have (as opposed to GlobalQuests) a different state for each player, that means if for one player the status of the Quest changes it does not for all the other players which also possess this quest. Creating a LocalQuest through XML goes as follows: //Where questId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information //The description of the quest. //A list of n subquest, be aware, each of the tags must have a description and so on and so forth as well. ... //A list of n QuestHints, see QuestHint for the full XML representation of those. ... //A list of QuestEffects, invoked when the Quest is failed, see QuestEffect for the full XML representation. ... //A list of QuestEffects, invoked when the Quest is completed, see QuestEffect for the full XML representation. ... @author Damian 'Mozork' Frick */ class _OrxonoxExport LocalQuest : public Quest { public: LocalQuest(BaseObject* creator); virtual ~LocalQuest(); virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a LocalQuest object through XML. virtual bool fail(ControllableEntity* player); //!< Fails the Quest. virtual bool complete(ControllableEntity* player); //!< Completes the Quest. protected: virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the Quest can be started. virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the Quest can be failed. virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the Quest can be completed. virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the Quest for a specific player. virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status); //!< Sets the status for a specific player. private: std::map playerStatus_; //!< List of the status for each player, with the Player-pointer as key. }; } #endif /* _LocalQuest_H__ */