The open source repository for the action RPG game in development by Sig Productions titled 'Adventures in Lestoria'!
https://forums.lestoria.net
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
820 B
39 lines
820 B
1 year ago
|
#pragma once
|
||
|
|
||
|
#include <string>
|
||
|
#include <functional>
|
||
|
#include <map>
|
||
|
#include "olcPixelGameEngine.h"
|
||
|
|
||
|
class Crawler;
|
||
|
class ItemInfo;
|
||
|
|
||
|
class Item{
|
||
|
private:
|
||
|
int amt;
|
||
|
ItemInfo*it;
|
||
|
};
|
||
|
|
||
|
class Inventory{
|
||
|
public:
|
||
|
void AddItem(std::string it,int amt=1);
|
||
|
void GetItemCount(std::string it);
|
||
|
void UseItem(std::string it,int amt=1);
|
||
|
void RemoveItem(std::string it,int amt=1);
|
||
|
private:
|
||
|
static std::map<std::string,Item>inventory;
|
||
|
};
|
||
|
|
||
|
class ItemInfo{
|
||
|
std::string name;
|
||
|
std::string displayName;
|
||
|
Decal*img;
|
||
|
//Returns true if the item can be used, false otherwise
|
||
|
std::function<bool(Crawler*)>useFunc;
|
||
|
public:
|
||
|
static void InitializeItems();
|
||
|
/*
|
||
|
For the useFunc, return true if the item can be used, false otherwise.
|
||
|
*/
|
||
|
ItemInfo(std::string name,std::string displayName,Decal*img,std::function<bool(Crawler*)>useFunc);
|
||
|
};
|