mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
add const accessor to Inventory
This commit is contained in:
@@ -378,6 +378,10 @@ unsigned int Inventory::size( ) const {
|
|||||||
return inv.size( );
|
return inv.size( );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto Inventory::get() const -> const std::vector<OBJECTTYPE>& {
|
||||||
|
return inv;
|
||||||
|
}
|
||||||
|
|
||||||
// Assignment operator
|
// Assignment operator
|
||||||
Inventory& Inventory::operator=(const Inventory& src)
|
Inventory& Inventory::operator=(const Inventory& src)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -772,6 +772,9 @@ public:
|
|||||||
// How any slots are there in this inventory?
|
// How any slots are there in this inventory?
|
||||||
unsigned int size() const;
|
unsigned int size() const;
|
||||||
|
|
||||||
|
// const-only accessor
|
||||||
|
auto get() const -> const std::vector<OBJECTTYPE>&;
|
||||||
|
|
||||||
//temporarily? public
|
//temporarily? public
|
||||||
std::vector<int> bNewItemCount;
|
std::vector<int> bNewItemCount;
|
||||||
std::vector<int> bNewItemCycleCount;
|
std::vector<int> bNewItemCycleCount;
|
||||||
|
|||||||
Reference in New Issue
Block a user