1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-08 03:37:45 +00:00

Use std::array instead of plain pointers

This commit is contained in:
Mordred 2023-02-03 08:43:16 +01:00
parent 4bb35c8bb8
commit 748a557156
2 changed files with 11 additions and 10 deletions

View file

@ -176,17 +176,17 @@ void Sapphire::FreeCompany::setFcVersion( uint32_t version )
m_fcVersion = version; m_fcVersion = version;
} }
const uint64_t *Sapphire::FreeCompany::getActiveActionIdArr() const const std::array< uint64_t, 3 >& Sapphire::FreeCompany::getActiveActionIdArr() const
{ {
return m_activeActionId; return m_activeActionId;
} }
const uint64_t *Sapphire::FreeCompany::getActiveActionTimeLeftArr() const const std::array< uint64_t, 3 >& Sapphire::FreeCompany::getActiveActionTimeLeftArr() const
{ {
return m_activeActionTimeLeft; return m_activeActionTimeLeft;
} }
const uint64_t *Sapphire::FreeCompany::getActionStockArr() const const std::array< uint64_t, 15 >& Sapphire::FreeCompany::getActionStockArr() const
{ {
return m_actionStock; return m_actionStock;
} }

View file

@ -3,6 +3,7 @@
#include <Common.h> #include <Common.h>
#include <set> #include <set>
#include <string> #include <string>
#include <array>
namespace Sapphire namespace Sapphire
{ {
@ -33,7 +34,7 @@ namespace Sapphire
/*! Current grand company of the fc */ /*! Current grand company of the fc */
uint8_t m_gc; uint8_t m_gc;
/*! Grand company reputation array */ /*! Grand company reputation array */
uint64_t m_gcReputation[ 3 ]; std::array< uint64_t, 3 > m_gcReputation;
/*! Status of the Company, Common::FreeCompanyStatus */ /*! Status of the Company, Common::FreeCompanyStatus */
Common::FreeCompanyStatus m_status; Common::FreeCompanyStatus m_status;
/*! Fc board text */ /*! Fc board text */
@ -43,11 +44,11 @@ namespace Sapphire
/*! Fc Version, unsure what this is used for */ /*! Fc Version, unsure what this is used for */
uint32_t m_fcVersion; uint32_t m_fcVersion;
/*! List of active actions */ /*! List of active actions */
uint64_t m_activeActionId[ 3 ]; std::array< uint64_t, 3 > m_activeActionId;
/*! List of remaining action times */ /*! List of remaining action times */
uint64_t m_activeActionTimeLeft[ 3 ]; std::array< uint64_t, 3 > m_activeActionTimeLeft;
/*! List of actions in stock */ /*! List of actions in stock */
uint64_t m_actionStock[ 15 ]; std::array< uint64_t, 15 > m_actionStock;
/*! ID list of all members */ /*! ID list of all members */
std::set< uint64_t > m_memberIds; std::set< uint64_t > m_memberIds;
@ -112,9 +113,9 @@ namespace Sapphire
uint32_t getFcVersion() const; uint32_t getFcVersion() const;
void setFcVersion( uint32_t version ); void setFcVersion( uint32_t version );
const uint64_t* getActiveActionIdArr() const; const std::array< uint64_t, 3 >& getActiveActionIdArr() const;
const uint64_t* getActiveActionTimeLeftArr() const; const std::array< uint64_t, 3 >& getActiveActionTimeLeftArr() const;
const uint64_t* getActionStockArr() const; const std::array< uint64_t, 15 >& getActionStockArr() const;
const std::set< uint64_t >& getMemberIdList() const; const std::set< uint64_t >& getMemberIdList() const;
std::set< uint64_t >& getMemberIdList(); std::set< uint64_t >& getMemberIdList();