Add Bot.h and Bot.cpp

This commit is contained in:
Lev
2021-06-13 17:11:24 -05:00
parent 312341dca6
commit fdfd01b0f3
14 changed files with 362 additions and 347 deletions

View File

@ -5,36 +5,28 @@
#include "OrderBookEntry.h"
#include <iostream>
class Wallet
class Wallet
{
public:
Wallet();
/** insert currency to the wallet */
void insertCurrency(std::string type, double amount);
/** remove currency from the wallet */
bool removeCurrency(std::string type, double amount);
/** check if the wallet contains this much currency or more */
bool containsCurrency(std::string type, double amount);
/** checks if the wallet can cope with this ask or bid.*/
bool canFulfillOrder(OrderBookEntry order);
/** update the contents of the wallet
public:
Wallet();
/** insert currency to the wallet */
void insertCurrency(std::string type, double amount);
/** remove currency from the wallet */
bool removeCurrency(std::string type, double amount);
/** check if the wallet contains this much currency or more */
bool containsCurrency(std::string type, double amount);
/** checks if the wallet can cope with this ask or bid.*/
bool canFulfillOrder(OrderBookEntry order);
/** update the contents of the wallet
* assumes the order was made by the owner of the wallet
*/
void processSale(OrderBookEntry& sale);
void processSale(OrderBookEntry &sale);
/** generate a string representation of the wallet */
std::string toString();
friend std::ostream &operator<<(std::ostream &os, Wallet &wallet);
/** generate a string representation of the wallet */
std::string toString();
friend std::ostream& operator<<(std::ostream& os, Wallet& wallet);
private:
std::map<std::string,double> currencies;
private:
std::map<std::string, double> currencies;
};