From 49411238b04f3510d18617d1498622cf199c617d Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Tue, 8 Dec 2015 08:35:21 -0500 Subject: documentation, dialog box borders --- include/Quest.h | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) (limited to 'include/Quest.h') diff --git a/include/Quest.h b/include/Quest.h index 75de64c..8f5446c 100644 --- a/include/Quest.h +++ b/include/Quest.h @@ -1,3 +1,10 @@ +/** @file Quest.h + * @brief The quest handling system. + * + * This file contains Quest and QuestHandler, used to manage quests inside the + * game. + */ + #ifndef QUEST_H #define QUEST_H @@ -6,24 +13,100 @@ #include #include +/** + * When defined, DEBUG allows extra messages to be printed to the terminal for + * debugging purposes. + */ + #define DEBUG +/** + * Contains the total number of quests in the game at compile time, see Quest.cpp + * for the actual definition of these quests. + */ + #define TOTAL_QUESTS 1 +/** + * The Quest class. + * + * This contains information for a single quest, and should only really be interacted + * with through QuestHandler. + */ + class Quest { public: - char *title,*desc; + + /** + * Contains the title of the quest. + */ + + char *title; + + /** + * Contains the description of the quest. + */ + + char *desc; + + /** + * Contains the single item that's given as a reward upon quest completion. + */ + struct item_t reward; + + /** + * Populates the values contained in this class. + */ + Quest(const char *t,const char *d,struct item_t r); + + /** + * Frees memory allocated for the title and description text. + */ + ~Quest(); }; +/** + * The Quest Handler class. + * + * This class handles quests, including the assigning, dropping, and completing + * of the quests. + */ + class QuestHandler { public: + + /** + * A vector containing all quests currently being taken by the handler. + */ + std::vectorcurrent; + + /** + * Adds a quest to the current quest vector by its title. + */ + int assign(const char *t); + + /** + * Drops a quest through its title. + */ + int drop(const char *t); + + /** + * Finishes a quest through it's title, also giving a pointer to the Entity + * that gave the quest originally. + */ + int finish(const char *t,void *completer); + + /** + * Returns true if this handler is currently taking the quest. + */ + bool hasQuest(const char *t); }; -- cgit v1.2.3