00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _TMWSERV_GAMESERVER_BUYSELL_HPP_
00023 #define _TMWSERV_GAMESERVER_BUYSELL_HPP_
00024
00025 #include <vector>
00026
00027 class Character;
00028 class Actor;
00029
00030 class BuySell
00031 {
00032 public:
00033
00037 BuySell(Character *, bool sell);
00038
00042 void cancel();
00043
00048 void registerItem(int id, int amount, int cost);
00049
00053 void start(Actor *actor);
00054
00058 void perform(int id, int amount);
00059
00060 private:
00061
00062 ~BuySell();
00063
00064 struct TradedItem
00065 {
00066 unsigned short itemId, amount, cost;
00067 };
00068
00069 typedef std::vector< TradedItem > TradedItems;
00070
00071 Character *mChar;
00072 TradedItems mItems;
00073 bool mSell;
00074 };
00075
00076 #endif