2012-08-09 12:56:03 +02:00
|
|
|
#ifndef GAME_MWBASE_JOURNAL_H
|
|
|
|
#define GAME_MWBASE_JOURNAL_H
|
|
|
|
|
|
|
|
#include <deque>
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
2022-08-16 21:15:03 +02:00
|
|
|
#include <string_view>
|
2012-08-09 12:56:03 +02:00
|
|
|
|
2022-01-22 22:44:02 +01:00
|
|
|
#include <cstdint>
|
2013-12-03 14:28:46 +01:00
|
|
|
|
2012-08-11 12:03:22 +02:00
|
|
|
#include "../mwdialogue/journalentry.hpp"
|
|
|
|
#include "../mwdialogue/quest.hpp"
|
|
|
|
#include "../mwdialogue/topic.hpp"
|
2012-08-09 12:56:03 +02:00
|
|
|
|
2014-04-28 11:29:57 +02:00
|
|
|
namespace Loading
|
|
|
|
{
|
|
|
|
class Listener;
|
|
|
|
}
|
|
|
|
|
2013-12-03 14:28:46 +01:00
|
|
|
namespace ESM
|
|
|
|
{
|
|
|
|
class ESMReader;
|
|
|
|
class ESMWriter;
|
|
|
|
}
|
|
|
|
|
2012-08-09 12:56:03 +02:00
|
|
|
namespace MWBase
|
|
|
|
{
|
|
|
|
/// \brief Interface for the player's journal (implemented in MWDialogue)
|
|
|
|
class Journal
|
|
|
|
{
|
|
|
|
Journal(const Journal&);
|
|
|
|
///< not implemented
|
|
|
|
|
|
|
|
Journal& operator=(const Journal&);
|
|
|
|
///< not implemented
|
|
|
|
|
|
|
|
public:
|
|
|
|
typedef std::deque<MWDialogue::StampedJournalEntry> TEntryContainer;
|
|
|
|
typedef TEntryContainer::const_iterator TEntryIter;
|
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 13:17:09 +02:00
|
|
|
typedef std::map<ESM::RefId, MWDialogue::Quest> TQuestContainer; // topic, quest
|
2012-08-09 12:56:03 +02:00
|
|
|
typedef TQuestContainer::const_iterator TQuestIter;
|
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 13:17:09 +02:00
|
|
|
typedef std::map<ESM::RefId, MWDialogue::Topic> TTopicContainer; // topic-id, topic-content
|
2012-08-09 12:56:03 +02:00
|
|
|
typedef TTopicContainer::const_iterator TTopicIter;
|
|
|
|
|
2022-09-22 21:26:05 +03:00
|
|
|
public:
|
2012-08-09 12:56:03 +02:00
|
|
|
Journal() {}
|
|
|
|
|
2013-05-15 17:54:18 +02:00
|
|
|
virtual void clear() = 0;
|
|
|
|
|
2012-08-09 12:56:03 +02:00
|
|
|
virtual ~Journal() {}
|
|
|
|
|
2023-07-01 01:30:25 +02:00
|
|
|
virtual MWDialogue::Quest& getOrStartQuest(const ESM::RefId& id) = 0;
|
|
|
|
///< Gets the quest requested. Creates it and inserts it in quests if it is not yet started.
|
|
|
|
virtual MWDialogue::Quest* getQuestOrNull(const ESM::RefId& id) = 0;
|
2023-06-12 21:35:00 -05:00
|
|
|
///< Gets a pointer to the requested quest. Will return nullptr if the quest has not been started.
|
|
|
|
|
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 13:17:09 +02:00
|
|
|
virtual void addEntry(const ESM::RefId& id, int index, const MWWorld::Ptr& actor) = 0;
|
2012-08-09 12:56:03 +02:00
|
|
|
///< Add a journal entry.
|
2016-01-11 23:07:01 +01:00
|
|
|
/// @param actor Used as context for replacing of escape sequences (%name, etc).
|
2012-08-09 12:56:03 +02: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 13:17:09 +02:00
|
|
|
virtual void setJournalIndex(const ESM::RefId& id, int index) = 0;
|
2012-08-09 12:56:03 +02:00
|
|
|
///< Set the journal index without adding an entry.
|
|
|
|
|
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 13:17:09 +02:00
|
|
|
virtual int getJournalIndex(const ESM::RefId& id) const = 0;
|
2012-08-09 12:56:03 +02: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 13:17:09 +02:00
|
|
|
virtual void addTopic(const ESM::RefId& topicId, const ESM::RefId& infoId, const MWWorld::Ptr& actor) = 0;
|
2014-06-10 16:36:22 +02: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 13:17:09 +02:00
|
|
|
virtual void removeLastAddedTopicResponse(const ESM::RefId& topicId, std::string_view actorName) = 0;
|
2014-06-10 16:36:22 +02:00
|
|
|
///< Removes the last topic response added for the given topicId and actor name.
|
|
|
|
/// \note topicId must be lowercase
|
2012-08-09 12:56:03 +02:00
|
|
|
|
|
|
|
virtual TEntryIter begin() const = 0;
|
|
|
|
///< Iterator pointing to the begin of the main journal.
|
|
|
|
///
|
|
|
|
/// \note Iterators to main journal entries will never become invalid.
|
|
|
|
|
|
|
|
virtual TEntryIter end() const = 0;
|
|
|
|
///< Iterator pointing past the end of the main journal.
|
|
|
|
|
|
|
|
virtual TQuestIter questBegin() const = 0;
|
|
|
|
///< Iterator pointing to the first quest (sorted by topic ID)
|
|
|
|
|
|
|
|
virtual TQuestIter questEnd() const = 0;
|
|
|
|
///< Iterator pointing past the last quest.
|
|
|
|
|
|
|
|
virtual TTopicIter topicBegin() const = 0;
|
|
|
|
///< Iterator pointing to the first topic (sorted by topic ID)
|
|
|
|
///
|
|
|
|
/// \note The topic ID is identical with the user-visible topic string.
|
|
|
|
|
|
|
|
virtual TTopicIter topicEnd() const = 0;
|
|
|
|
///< Iterator pointing past the last topic.
|
2013-12-03 14:28:46 +01:00
|
|
|
|
|
|
|
virtual int countSavedGameRecords() const = 0;
|
|
|
|
|
2014-04-28 11:29:57 +02:00
|
|
|
virtual void write(ESM::ESMWriter& writer, Loading::Listener& progress) const = 0;
|
2013-12-03 14:28:46 +01:00
|
|
|
|
2015-01-22 19:04:59 +01:00
|
|
|
virtual void readRecord(ESM::ESMReader& reader, uint32_t type) = 0;
|
2012-08-09 12:56:03 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|