프로젝트 | Laboratory
클래스 설계 변경


Inventory, Item Class
인벤토리와 아이템 관리 기능을 담당.
Item.h
#pragma once
using namespace std;
class Item
{
private:
string sItemName; // 아이템 이름
int price; // 아이템 가격
int itemCount; // 수량
public:
Item(); // 생성자
// Getter
string GetsItemName() const;
int GetiPrice() const;
int GetiItemCount() const;
// Setter
void SetsItemName(string& sItemName_);
void SetiPrice(int& price_);
void SetsItemCount(int& ItemCount_);
};
Inventory.h
#pragma once
#include <map>
using namespace std;
class Item;
class Inventory
{
private:
map<string, Item> mInventory; // 인벤토리 저장소 key : n번슬롯, value : 아이템
int capacity; // 인벤토리 용량
public:
Inventory(); // 생성자
~Inventory(); // 소멸자
map<string, Item> GetInventory() const; // Getter
void AddItem(string itemName_, Item* Item_); // 인벤토리에 아이템 추가
void RemoveItem(const Item* Item_); // 인벤토리에 있는 아이템 삭제
void UseItem(); // 아이템 사용
void ShowInventory(); // 인벤토리 내용 출력 -> 테스트용 함수
};
Git
main > develop > 팀원 브랜치
위처럼 구성하여 develop에서 체크포인트 형식으로 Merge 진행할 예정 추후 완성 된 것들은 main으로 이동
'언리얼' 카테고리의 다른 글
| [2025.01.02] Unreal_7기 25 일차 | C++ 3 주차 (0) | 2026.01.02 |
|---|---|
| [2025.12.31] Unreal_7기 24 일차 | C++ 3 주차 (0) | 2025.12.31 |
| [2025.12.29] Unreal_7기 22 일차 | C++ 3 주차 (0) | 2025.12.29 |
| [2025.12.26] Unreal_7기 21 일차 | C++ 3 주차 (0) | 2025.12.26 |
| [2025.12.24] Unreal_7기 20 일차 | C++ 3 주차 (0) | 2025.12.24 |
