Stock Market Simulator main e8c3612
A game that provides a realistic stock buying experience with unpredictable trends to test investment strategies.
|
Implementation of the Stock class. More...
#include "stock.h"
#include "file_io.h"
#include "format.h"
#include "names.h"
#include "random_price.h"
#include <algorithm>
#include <cassert>
#include <fstream>
#include <iostream>
Go to the source code of this file.
Functions | |
std::ostream & | operator<< (std::ostream &fout, const Stock &stock) |
std::istream & | operator>> (std::istream &fin, Stock &stock) |
void | sortStocksList (std::vector< Stock > &stocks_list, SortingMethods sortMethod, SortingDirections sortDirection) |
Sorts the stocks. | |
Variables | |
const int | INVALID_OPERATION = -1 |
std::ostream & operator<< | ( | std::ostream & | fout, |
const Stock & | stock ) |
Definition at line 71 of file stock.cpp.
std::istream & operator>> | ( | std::istream & | fin, |
Stock & | stock ) |
Definition at line 94 of file stock.cpp.
void sortStocksList | ( | std::vector< Stock > & | stocks_list, |
SortingMethods | sortMethod = by_category, | ||
SortingDirections | sortDirection = ascending ) |
Sorts the stocks.
stocks_list | A vector of stocks. Pass by reference to modify the stocks. |
sortMethod | Sorting method. Default is by_category. |
sortDirection | Sorting direction. True for ascending, false for descending. Default is ascending. |
Definition at line 321 of file stock.cpp.
References by_category, by_lower_limit, by_mean, by_name, by_price, by_quantity, by_sd, by_upper_limit, and descending.
Referenced by main().
const int INVALID_OPERATION = -1 |
Definition at line 27 of file stock.cpp.
Referenced by Stock::purchase(), and Stock::sell().