aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-03-04 08:47:03 -0500
committerClyne Sullivan <tullivan99@gmail.com>2016-03-04 08:47:03 -0500
commit0a06697db87063b77b71388278933807899568ef (patch)
treebb8d876e266761c7aac8656c2d75793855826bd0 /include
parent5fadac5d0f37f574ca160107d832d11b421ad559 (diff)
parent30dd8efe8d71648bea7604ebee5afc4d55b25a6b (diff)
merge
Diffstat (limited to 'include')
-rw-r--r--include/entities.h31
-rw-r--r--include/inventory.h1
-rw-r--r--include/ui.h2
3 files changed, 17 insertions, 17 deletions
diff --git a/include/entities.h b/include/entities.h
index c10bcd4..ef421f5 100644
--- a/include/entities.h
+++ b/include/entities.h
@@ -52,22 +52,20 @@ enum BUILD_SUB{
STALL_TRADER = 71
};
-class BuySell{
+class Trade{
public:
- int member;
- union{
- struct{
- std::string item1;
- std::string item2;
- }trade;
- struct{
- enum type{BUY,SELL};
- std::string item;
- int price;
- }cost;
- };
- BuySell(){}
- ~BuySell(){}
+ std::string item[2];
+ int quantity[2];
+ Trade(int qo, const char* o, int qt, const char* t){
+ item[0] = o;
+ item[1] = t;
+
+ quantity[0] = qo;
+ quantity[1] = qt;
+
+ std::cout << "Trading: " << quantity[0] << " " << item[0] << " for " << quantity[1] << " " << item[1] << std::endl;
+ }
+ Trade(){}
};
class World;
@@ -220,7 +218,8 @@ public:
class Merchant : public NPC{
public:
- std::vector<BuySell>bsinv;
+ std::vector<Trade>trade;
+
void interact();
Merchant();
diff --git a/include/inventory.h b/include/inventory.h
index 8225ab2..69cf073 100644
--- a/include/inventory.h
+++ b/include/inventory.h
@@ -62,6 +62,7 @@ void initInventorySprites(void);
void destroyInventory(void);
const char *getItemTexturePath(std::string name);
+GLuint getItemTexture(std::string name);
float getItemWidth(std::string name);
float getItemHeight(std::string name);
diff --git a/include/ui.h b/include/ui.h
index 667a581..ed9fb94 100644
--- a/include/ui.h
+++ b/include/ui.h
@@ -146,7 +146,7 @@ namespace ui {
*/
void dialogBox(const char *name,const char *opt,bool passive,const char *text,...);
- void merchantBox(const char *name, std::vector<BuySell> *items, const char *opt,bool passive,const char *text,...);
+ void merchantBox(const char *name,Trade trade,const char *opt,bool passive,const char *text,...);
void merchantBox();
void waitForDialog(void);