嘿,我想知道是否有C ++ RPG库存系统的教程或示例代码。我浏览了网站,我发现只创建了两个类,项目和库存,并将每个类用于项目的详细信息,并将项目保存在链接列表中。
这是我到目前为止所拥有的......
using namespace std;
int maxWeight;
class inventory { //manages the entire inventory
public:
inventory();
inventory::inventory(int defaultWeight = maxWeight);
private:
int maxWeight = 100;
};
class item { //holds the details about a particular item
public:
item();
item(char* name, double weight);
private:
char* name;
double weight;
};
我希望我长时间搜索这样的教程可以结束..
谢谢。
答案 0 :(得分:0)
基本上,根据我的理解,到目前为止,您要查找的是库存中的链接列表,用于存储所有项目。了解链表的工作原理并从那里开始。您可能需要