Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

/home/groups/n/no/noxwizard/cvs/src/trade.h

Go to the documentation of this file.
00001   /*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
00002     || NoX-Wizard UO Server Emulator (NXW) [http://noxwizard.sourceforge.net]  ||
00003     ||                                                                         ||
00004     || This software is free software released under GPL2 license.             ||
00005     || You can find detailed license information in nox-wizard.cpp file.       ||
00006     ||                                                                         ||
00007     || For any question post to NoX-Wizard forums.                             ||
00008     -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*/
00009 
00010 #ifndef __TRADE_H__
00011 #define __TRADE_H__
00012 
00013 void buyaction(int s);
00014 void sellaction(int s);
00015 P_ITEM tradestart(P_CHAR pc1, P_CHAR pc2);
00016 void clearalltrades();
00017 void trademsg(int s);
00018 void dotrade(P_ITEM cont1,P_ITEM cont2);
00019 
00020 
00021 typedef struct {
00022         int layer;
00023         P_ITEM item;
00024         int amount;
00025 } buyeditem;
00026 
00027 #define RESTOCK_PER_TIME 20
00028 #define CHECK_RESTOCK_EVERY 3
00029 
00030 #include <queue>
00031 
00032 class cRestockMng {
00033 
00034 private:
00035 
00036         TIMERVAL timer;
00037         std::queue< SERIAL > needrestock;
00038         std::queue< SERIAL > restocked;
00039 
00040         void rewindList();
00041         void updateTimer();
00042 
00043 
00044 public:
00045         
00046         cRestockMng();
00047 
00048 
00049         void doRestock();
00050         void doRestockAll();
00051 
00052         void addNewRestock( P_ITEM pi );
00053 
00054 };
00055 
00056 extern cRestockMng* Restocks;
00057 
00058 
00059 #endif
SourceForge.net Logo