From 16deb2b7553a2ecb16606e72a925fd53cbb736c7 Mon Sep 17 00:00:00 2001 From: Lukas Pioch Date: Tue, 1 Aug 2017 20:55:41 +0200 Subject: APIDcoc: Added return value in constructor, AString as ref and updated comment --- Server/Plugins/APIDump/APIDesc.lua | 7 +++++++ src/BookContent.h | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Server/Plugins/APIDump/APIDesc.lua b/Server/Plugins/APIDump/APIDesc.lua index 251c2e4fb..a22eab601 100644 --- a/Server/Plugins/APIDump/APIDesc.lua +++ b/Server/Plugins/APIDump/APIDesc.lua @@ -7028,6 +7028,12 @@ This class contains the information for a signed or writeable book: The author, { constructor = { + Returns = + { + { + Type = "cBookContent", + }, + }, Notes = "Creates a empty book", }, SetAuthor = @@ -7098,6 +7104,7 @@ This class contains the information for a signed or writeable book: The author, Params = { { + Name = "Pages", Type = "table", }, }, diff --git a/src/BookContent.h b/src/BookContent.h index 001da824c..67c980c0a 100644 --- a/src/BookContent.h +++ b/src/BookContent.h @@ -20,13 +20,13 @@ public: void SetAuthor(const AString & a_Author) { m_Author = a_Author; } /** Returns the author of the book */ - const AString GetAuthor(void) const { return m_Author; } + const AString & GetAuthor(void) const { return m_Author; } /** Set the title of the book */ void SetTitle(const AString & a_Title) { m_Title = a_Title; } /** Returns the title of the book */ - const AString GetTitle(void) const { return m_Title; } + const AString & GetTitle(void) const { return m_Title; } /** Add a page to the end of the book */ void AddPage(const AString & a_Page) { m_Pages.emplace_back(a_Page); } @@ -42,7 +42,7 @@ public: /** Returns a AStringVector ref to the pages. Used in ManualBindings and for saving the book */ const AStringVector & GetPages(void) const { return m_Pages; } - /** Read the book content from nbt. The boolean a_SaveAsJson is optional. If a player creates a book, the text should be in a json string */ + /** Read the book content from nbt. The boolean a_SaveAsJson is optional. If the book is signed, the text should be in a json string */ static void ParseFromNBT(int TagTag, cBookContent & a_BookContent, const cParsedNBT & a_NBT, bool a_SaveAsJson = false); /** Write book content to nbt */ -- cgit v1.2.3