add const accessor to Inventory

This commit is contained in:
Marco Costa
2024-04-03 22:09:05 -03:00
committed by majcosta
parent fad3a27059
commit d670383f3a
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -378,6 +378,10 @@ unsigned int Inventory::size( ) const {
return inv.size( );
}
auto Inventory::get() const -> const std::vector<OBJECTTYPE>& {
return inv;
}
// Assignment operator
Inventory& Inventory::operator=(const Inventory& src)
{
+3
View File
@@ -772,6 +772,9 @@ public:
// How any slots are there in this inventory?
unsigned int size() const;
// const-only accessor
auto get() const -> const std::vector<OBJECTTYPE>&;
//temporarily? public
std::vector<int> bNewItemCount;
std::vector<int> bNewItemCycleCount;