📄 iteminfo.h
字号:
#ifndef ITEMINFO_H
#define ITEMINFO_H
#include <iostream>
#include <string>
#include "AppException.h"
#include "Node.h"
using namespace std;
class ItemInfo {
friend ostream& operator<<(ostream& os, const ItemInfo& item);
public:
ItemInfo(string name);
ItemInfo(string name, int count);
ItemInfo() {};
virtual ~ItemInfo() {};
bool operator<(const ItemInfo& anotherItemInfo) const;
bool operator>(const ItemInfo& anotherItemInfo) const;
string getName() const;
int getCount() const;
void incrementCount();
void incrementCount(int i);
void resetCount();
Node* getStartNode();
Node* getLastNode();
void setStartNode(Node* node);
void setLastNode(Node* node);
private:
string mName;
int mCount;
Node* startNode;
Node* lastNode;
};
inline ostream& operator<<(ostream& os, const ItemInfo& itemInfo) {
os << "Name: " << itemInfo.getName();
os << " Count: " << itemInfo.getCount();
return os;
};
#endif /* ITEMINFO_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -