-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinventory.h
39 lines (33 loc) · 931 Bytes
/
inventory.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// inventory.h
// Michael Bottini
// Created for CS260
// June 25, 2015
// Defines inventory class.
#ifndef INVENTORY_H
#define INVENTORY_H
#include <iostream>
#include "item.h"
#include "itemnode.h"
class inventory {
private:
itemNode *_head;
double _weight;
int _count;
double _maxWeight;
public:
void init();
inventory(int maxWeight = 100);
inventory(const inventory& originalInventory);
inventory& operator =(const inventory& originalInventory);
void chainDelete();
~inventory();
double getWeight() const;
int getCount() const;
itemNode* getHead() const;
void AddItem(const item& newItem);
void addWeightAndCount(itemNode* node, const item& newItem);
void subtractWeightAndCount(const item& newItem);
void RemoveItem(const char* name);
void PrintInventory();
};
#endif