mElite  1.0
An Elite clone based on TextElite by Jan-Philipp Kappmeier and Melanie Schmidt.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Wrapper.h
Go to the documentation of this file.
1 
6 #pragma once
7 
9 #include "wrappDef.h"
11 #include "txtelite.h"
12 
14 #include <vector>
15 #include <string>
16 
18 
24 class Wrapper
25 {
26 public:
27  /*********************** * functions: constructor and destructor ************** */
28  Wrapper(void (*userErrorFnc)(std::string), void (*progErrorFnc)(std::string) );
29  ~Wrapper(void);
30 
31  /*************** * functions: control functions (or cheating) ***************** */
32  void setCash(float amount);
33  void setFuel(float amount);
34  void setCargoBay(unsigned int amount);
35  void addCash(float amount);
36  void addFuel(float amount);
37  void addCargoSpace(unsigned int amount);
38 
39  /************************ * functions: get functions ************************** */
40  System getSystemInfo(int number);
41  int getCurrentSystem();
42  std::vector<int> * getLocalSystems();
43  std::vector<int> * getSystemsInRectangle(int left, int right, int bottom, int top);
44  bool systemIsReachable(int number);
45  bool systemIsInLocalRange(int number);
46 
47  float getMaxFuel();
48  float getFuelAmount();
49 
51  std::vector<Tradegood> * getAllTradegoodDescriptions();
53  bool tradegoodIsInTons(int);
54  std::vector<MarketplaceItem> * getCurrentMarketplace();
55  float getFuelCost();
56  std::vector<int> * getCurrentCargo();
57  unsigned int getFreeHoldspace();
58  float getCurrentCash();
59  unsigned int getCargoBaySize();
60 
61  /*********************** * functions: actions ********************************* */
62  void buyFuel(float amount);
63  void performJump(int number);
64  std::string performPurchase(int number, int amount);
65  std::string performSale(int number, int amount);
66 
67  /**************************** * variables ************************************* */
68 private:
69  /******************* * object of the textEliteGame **************************** */
70  TextEliteGame *txtgame;
71 
72  /********* * pointers to error functions to report occuring errors ************ */
73  void (*vuserErrorFnc)(std::string);
74  void (*vprogErrorFnc)(std::string);
75 
76  /***************************** * help variables ******************************* */
77  static const int numberOfTradegoods = 17;
78  Tradegood tradegoods[numberOfTradegoods];
79 };
80