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.
AdventuresInLestoria/Crawler/Item.h

60 lines
1.3 KiB

#pragma once
#include <string>
#include <functional>
#include <map>
#include "olcPixelGameEngine.h"
#include "olcUTIL_DataFile.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 ItemProps{
friend class ItemInfo;
utils::datafile*scriptProps;
utils::datafile*customProps;
public:
ItemProps(utils::datafile*scriptProps,utils::datafile*customProps);
int GetIntProp(std::string prop);
float GetFloatProp(std::string prop);
std::string GetStringProp(std::string prop);
};
class ItemInfo{
std::string name;
std::string description;
std::string category;
Decal*img;
//Returns true if the item can be used, false otherwise
std::string useFunc="";
//Custom properties for this specific item's script.
static utils::datafile NOPROPS;
std::string script;
ItemProps customProps;
private:
static void InitializeScripts();
public:
static void InitializeItems();
ItemInfo();
/*
For the useFunc, return true if the item can be used, false otherwise.
*/
//ItemInfo(std::string name,std::string description,std::string category,Decal*img,utils::datafile&props,std::string useFunc);
};