2017-06-27 05:27:14 +00:00
|
|
|
#ifndef OPENMW_BOOKAPI_HPP
|
|
|
|
#define OPENMW_BOOKAPI_HPP
|
|
|
|
|
2019-01-15 12:26:11 +00:00
|
|
|
#include "../api.h"
|
2019-01-15 11:41:58 +00:00
|
|
|
|
2019-01-15 12:26:11 +00:00
|
|
|
NAMESPACE_BEGIN(BookFunctions)
|
2017-06-27 05:27:14 +00:00
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Clear the last recorded book changes for a player.
|
|
|
|
*
|
|
|
|
* This is used to initialize the sending of new PlayerBook packets.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose book changes should be used.
|
|
|
|
* \return void
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION void CDECL ClearBookChanges(PlayerId pid) NOEXCEPT;
|
2017-07-07 06:25:48 +00:00
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Get the number of indexes in a player's latest book changes.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose book changes should be used.
|
|
|
|
* \return The number of indexes.
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION unsigned int CDECL GetBookChangesSize(PlayerId pid) NOEXCEPT;
|
2017-06-27 05:27:14 +00:00
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Add a new book to the book changes for a player.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose book changes should be used.
|
2017-07-20 14:58:00 +00:00
|
|
|
* \param bookId The bookId of the book.
|
2017-07-19 17:40:51 +00:00
|
|
|
* \return void
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION void CDECL AddBook(PlayerId pid, const char* bookId) NOEXCEPT;
|
2017-06-27 05:27:14 +00:00
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Get the bookId at a certain index in a player's latest book changes.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose book changes should be used.
|
2018-07-24 17:14:51 +00:00
|
|
|
* \param index The index of the book.
|
2017-07-19 17:40:51 +00:00
|
|
|
* \return The bookId.
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION const char *CDECL GetBookId(PlayerId pid, unsigned int index) NOEXCEPT;
|
2017-06-27 05:27:14 +00:00
|
|
|
|
2017-07-19 17:40:51 +00:00
|
|
|
/**
|
|
|
|
* \brief Send a PlayerBook packet with a player's recorded book changes.
|
|
|
|
*
|
|
|
|
* \param pid The player ID whose book changes should be used.
|
2018-07-07 15:29:31 +00:00
|
|
|
* \param sendToOtherPlayers Whether this packet should be sent to players other than the
|
|
|
|
* player attached to the packet (false by default).
|
2018-07-07 17:16:36 +00:00
|
|
|
* \param skipAttachedPlayer Whether the packet should skip being sent to the player attached
|
|
|
|
* to the packet (false by default).
|
2017-07-19 17:40:51 +00:00
|
|
|
* \return void
|
|
|
|
*/
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION void CDECL SendBookChanges(PlayerId pid, bool sendToOtherPlayers, bool skipAttachedPlayer) NOEXCEPT;
|
2017-07-19 17:40:51 +00:00
|
|
|
|
2018-10-02 23:26:47 +00:00
|
|
|
// All methods below are deprecated versions of methods from above
|
|
|
|
|
2019-01-16 15:52:22 +00:00
|
|
|
API_FUNCTION void CDECL InitializeBookChanges(PlayerId pid) NOEXCEPT;
|
2019-01-15 12:26:11 +00:00
|
|
|
NAMESPACE_END()
|
2017-06-27 05:27:14 +00:00
|
|
|
|
|
|
|
#endif //OPENMW_BOOKAPI_HPP
|