프로젝트 | Laboratory


클래스 설계 변경

전투및 플레이어 클래스 변경

 

인벤토리, UI, 매니저 클래스

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으로 이동

+ Recent posts