1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00
OpenMW/apps/openmw/mwdialogue/journalimp.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

81 lines
2.8 KiB
C++
Raw Normal View History

2012-08-11 10:02:51 +00:00
#ifndef GAME_MWDIALOG_JOURNAL_H
2011-04-04 09:16:56 +00:00
#define GAME_MWDIALOG_JOURNAL_H
#include "../mwbase/journal.hpp"
2011-04-26 18:08:37 +00:00
#include "quest.hpp"
2011-04-04 09:23:15 +00:00
2011-04-04 09:16:56 +00:00
namespace MWDialogue
{
2011-04-26 18:08:37 +00:00
/// \brief The player's journal
class Journal : public MWBase::Journal
2011-04-04 09:16:56 +00:00
{
TEntryContainer mJournal;
2011-04-26 18:08:37 +00:00
TQuestContainer mQuests;
2011-04-26 18:48:36 +00:00
TTopicContainer mTopics;
2011-04-26 18:08:37 +00:00
2013-12-03 13:28:46 +00:00
private:
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID Slowly going through all the changes to make, still hundreds of errors a lot of functions/structures use std::string or stringview to designate an ID. So it takes time Continues slowly replacing ids. There are technically more and more compilation errors I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type Continue moving forward, changes to the stores slowly moving along Starting to see the fruit of those changes. still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type. More replacements. Things are starting to get easier I can see more and more often the issue is that the function is awaiting a RefId, but is given a string there is less need to go down functions and to fix a long list of them. Still moving forward, and for the first time error count is going down! Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably Cells are back to using string for the name, haven't fixed everything yet. Many other changes Under the bar of 400 compilation errors. more good progress <100 compile errors! More progress Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string some more progress on other fronts Mostly game settings clean one error opened a lot of other errors. Down to 18, but more will prbably appear only link errors left?? Fixed link errors OpenMW compiles, and launches, with some issues, but still!
2022-09-25 11:17:09 +00:00
Topic& getTopic(const ESM::RefId& id);
2011-04-04 09:16:56 +00:00
bool isThere(const ESM::RefId& topicId, const ESM::RefId& infoId = ESM::RefId()) const;
2013-12-03 13:28:46 +00:00
public:
Journal();
void clear() override;
2011-04-04 09:16:56 +00:00
2023-06-30 23:30:25 +00:00
Quest* getQuestOrNull(const ESM::RefId& id) override;
2023-06-13 02:35:00 +00:00
///< Gets a pointer to the requested quest. Will return nullptr if the quest has not been started.
2023-06-30 23:30:25 +00:00
Quest& getOrStartQuest(const ESM::RefId& id) override;
///< Gets the quest requested. Attempts to create it and inserts it in quests if it is not yet started.
2023-06-13 02:35:00 +00:00
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID Slowly going through all the changes to make, still hundreds of errors a lot of functions/structures use std::string or stringview to designate an ID. So it takes time Continues slowly replacing ids. There are technically more and more compilation errors I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type Continue moving forward, changes to the stores slowly moving along Starting to see the fruit of those changes. still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type. More replacements. Things are starting to get easier I can see more and more often the issue is that the function is awaiting a RefId, but is given a string there is less need to go down functions and to fix a long list of them. Still moving forward, and for the first time error count is going down! Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably Cells are back to using string for the name, haven't fixed everything yet. Many other changes Under the bar of 400 compilation errors. more good progress <100 compile errors! More progress Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string some more progress on other fronts Mostly game settings clean one error opened a lot of other errors. Down to 18, but more will prbably appear only link errors left?? Fixed link errors OpenMW compiles, and launches, with some issues, but still!
2022-09-25 11:17:09 +00:00
void addEntry(const ESM::RefId& id, int index, const MWWorld::Ptr& actor) override;
///< Add a journal entry.
/// @param actor Used as context for replacing of escape sequences (%name, etc).
2011-04-04 09:23:15 +00:00
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID Slowly going through all the changes to make, still hundreds of errors a lot of functions/structures use std::string or stringview to designate an ID. So it takes time Continues slowly replacing ids. There are technically more and more compilation errors I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type Continue moving forward, changes to the stores slowly moving along Starting to see the fruit of those changes. still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type. More replacements. Things are starting to get easier I can see more and more often the issue is that the function is awaiting a RefId, but is given a string there is less need to go down functions and to fix a long list of them. Still moving forward, and for the first time error count is going down! Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably Cells are back to using string for the name, haven't fixed everything yet. Many other changes Under the bar of 400 compilation errors. more good progress <100 compile errors! More progress Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string some more progress on other fronts Mostly game settings clean one error opened a lot of other errors. Down to 18, but more will prbably appear only link errors left?? Fixed link errors OpenMW compiles, and launches, with some issues, but still!
2022-09-25 11:17:09 +00:00
void setJournalIndex(const ESM::RefId& id, int index) override;
2011-04-04 09:23:15 +00:00
///< Set the journal index without adding an entry.
2013-05-15 15:54:18 +00:00
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID Slowly going through all the changes to make, still hundreds of errors a lot of functions/structures use std::string or stringview to designate an ID. So it takes time Continues slowly replacing ids. There are technically more and more compilation errors I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type Continue moving forward, changes to the stores slowly moving along Starting to see the fruit of those changes. still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type. More replacements. Things are starting to get easier I can see more and more often the issue is that the function is awaiting a RefId, but is given a string there is less need to go down functions and to fix a long list of them. Still moving forward, and for the first time error count is going down! Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably Cells are back to using string for the name, haven't fixed everything yet. Many other changes Under the bar of 400 compilation errors. more good progress <100 compile errors! More progress Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string some more progress on other fronts Mostly game settings clean one error opened a lot of other errors. Down to 18, but more will prbably appear only link errors left?? Fixed link errors OpenMW compiles, and launches, with some issues, but still!
2022-09-25 11:17:09 +00:00
int getJournalIndex(const ESM::RefId& id) const override;
2011-04-04 09:23:15 +00:00
///< Get the journal index.
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID Slowly going through all the changes to make, still hundreds of errors a lot of functions/structures use std::string or stringview to designate an ID. So it takes time Continues slowly replacing ids. There are technically more and more compilation errors I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type Continue moving forward, changes to the stores slowly moving along Starting to see the fruit of those changes. still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type. More replacements. Things are starting to get easier I can see more and more often the issue is that the function is awaiting a RefId, but is given a string there is less need to go down functions and to fix a long list of them. Still moving forward, and for the first time error count is going down! Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably Cells are back to using string for the name, haven't fixed everything yet. Many other changes Under the bar of 400 compilation errors. more good progress <100 compile errors! More progress Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string some more progress on other fronts Mostly game settings clean one error opened a lot of other errors. Down to 18, but more will prbably appear only link errors left?? Fixed link errors OpenMW compiles, and launches, with some issues, but still!
2022-09-25 11:17:09 +00:00
void addTopic(const ESM::RefId& topicId, const ESM::RefId& infoId, const MWWorld::Ptr& actor) override;
2011-04-04 09:23:15 +00:00
/// \note topicId must be lowercase
Initial commit: In ESM structures, replace the string members that are RefIds to other records, to a new strong type The strong type is actually just a string underneath, but this will help in the future to have a distinction so it's easier to search and replace when we use an integer ID Slowly going through all the changes to make, still hundreds of errors a lot of functions/structures use std::string or stringview to designate an ID. So it takes time Continues slowly replacing ids. There are technically more and more compilation errors I have good hope that there is a point where the amount of errors will dramatically go down as all the main functions use the ESM::RefId type Continue moving forward, changes to the stores slowly moving along Starting to see the fruit of those changes. still many many error, but more and more Irun into a situation where a function is sandwiched between two functions that use the RefId type. More replacements. Things are starting to get easier I can see more and more often the issue is that the function is awaiting a RefId, but is given a string there is less need to go down functions and to fix a long list of them. Still moving forward, and for the first time error count is going down! Good pace, not sure about topics though, mId and mName are actually the same thing and are used interchangeably Cells are back to using string for the name, haven't fixed everything yet. Many other changes Under the bar of 400 compilation errors. more good progress <100 compile errors! More progress Game settings store can use string for find, it was a bit absurd how every use of it required to create refId from string some more progress on other fronts Mostly game settings clean one error opened a lot of other errors. Down to 18, but more will prbably appear only link errors left?? Fixed link errors OpenMW compiles, and launches, with some issues, but still!
2022-09-25 11:17:09 +00:00
void removeLastAddedTopicResponse(const ESM::RefId& topicId, std::string_view actorName) override;
2011-04-04 09:23:15 +00:00
///< Removes the last topic response added for the given topicId and actor name.
/// \note topicId must be lowercase
TEntryIter begin() const override;
///< Iterator pointing to the begin of the main journal.
2022-09-22 18:26:05 +00:00
///
/// \note Iterators to main journal entries will never become invalid.
2022-08-16 19:15:03 +00:00
TEntryIter end() const override;
///< Iterator pointing past the end of the main journal.
2011-04-26 18:48:36 +00:00
TQuestIter questBegin() const override;
///< Iterator pointing to the first quest (sorted by topic ID)
TQuestIter questEnd() const override;
///< Iterator pointing past the last quest.
2011-04-26 18:08:37 +00:00
TTopicIter topicBegin() const override;
2011-04-26 18:08:37 +00:00
///< Iterator pointing to the first topic (sorted by topic ID)
2022-09-22 18:26:05 +00:00
///
2011-04-26 18:08:37 +00:00
/// \note The topic ID is identical with the user-visible topic string.
TTopicIter topicEnd() const override;
2011-04-26 18:08:37 +00:00
///< Iterator pointing past the last topic.
2011-04-26 18:48:36 +00:00
int countSavedGameRecords() const override;
2011-04-26 18:48:36 +00:00
void write(ESM::ESMWriter& writer, Loading::Listener& progress) const override;
2013-12-03 13:28:46 +00:00
void readRecord(ESM::ESMReader& reader, uint32_t type) override;
2011-04-04 09:16:56 +00:00
};
}
#endif