EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
NPCMarket.h
Go to the documentation of this file.
1 /*
2  * File: NPCMarket.h
3  * Author: Rob R
4  *
5  * Created on June 10, 2014, 5:13 AM
6  *
7  * example usage:
8  * NPCMarket::CreateNPCMarketFromFile("/etc/npcMarket.xml");
9  *
10  * format for the xml file as follows.
11  *
12  * <npcMarketOrders>
13  * <Station>
14  * <StationID>60000004</StationID>
15  * <Order>
16  * <TypeID>41</TypeID>
17  * <Qty>23572</Qty>
18  * <Price>25.52</Price>
19  * <Bid>0</Bid>
20  * </Order>
21  * <Order>
22  * <TypeID>43</TypeID>
23  * <Qty>59656</Qty>
24  * <Price>333.96</Price>
25  * <Bid>1</Bid>
26  * </Order>
27  * ....
28  * </station>
29  * <station>
30  * ....
31  * </station>
32  * </npcMarketOrders>
33  */
34 
35 #ifndef NPCMARKET_H
36 #define NPCMARKET_H
37 
38 #include "MarketDB.h"
39 
40 
41 class NPCMarket
42 : public XMLParserEx
43 {
44 public:
45  NPCMarket();
46 
51  static void CreateNPCMarketFromFile(std::string filename);
52 
53 private:
62 
66  struct stationOrder {
78  double Price;
83  } order;
87  std::list<stationOrder> newOrders;
88 
94  bool ProcessNPCOrders( const TiXmlElement* ele );
100  bool ProcessStation( const TiXmlElement* ele );
106  bool ProcessOrder( const TiXmlElement* ele );
107 
108 };
109 
110 #endif /* NPCMARKET_H */
111 
MarketDB m_db
Definition: NPCMarket.h:57
static void CreateNPCMarketFromFile(std::string filename)
Definition: NPCMarket.cpp:16
std::list< stationOrder > newOrders
Definition: NPCMarket.h:87
bool ProcessOrder(const TiXmlElement *ele)
Definition: NPCMarket.cpp:146
bool ProcessNPCOrders(const TiXmlElement *ele)
Definition: NPCMarket.cpp:43
uint32 StationID
Definition: NPCMarket.h:61
A somewhat extended version of XMLParser.
Definition: XMLParserEx.h:37
unsigned __int32 uint32
Definition: eve-compat.h:50
bool ProcessStation(const TiXmlElement *ele)
Definition: NPCMarket.cpp:65
struct NPCMarket::stationOrder order