Добавлена система сохранений
This commit is contained in:
@@ -9,6 +9,8 @@ struct InventorySlot {
|
||||
|
||||
class Inventory {
|
||||
public:
|
||||
std::vector<InventorySlot> items;
|
||||
|
||||
void addItem(int itemId, int count = 1);
|
||||
bool removeItem(int itemId, int count = 1);
|
||||
|
||||
@@ -16,6 +18,5 @@ public:
|
||||
|
||||
bool hasItem(int itemId) const;
|
||||
|
||||
private:
|
||||
std::vector<InventorySlot> items;
|
||||
|
||||
};
|
||||
11
include/save_manager.h
Normal file
11
include/save_manager.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "player.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class SaveManager {
|
||||
public:
|
||||
static bool saveGame(const Player& player, const std::string& path);
|
||||
static bool loadGame(Player& player, const std::string& path);
|
||||
};
|
||||
Reference in New Issue
Block a user