Stock Market Simulator main e8c3612
A game that provides a realistic stock buying experience with unpredictable trends to test investment strategies.
|
Declaration of the Stock class. More...
#include "events.h"
#include "names.h"
#include <istream>
#include <list>
#include <map>
#include <string>
#include <vector>
Go to the source code of this file.
Classes | |
class | Stock |
A class that represents a stock object in the game. More... | |
Enumerations | |
enum | SortingDirections { ascending , descending } |
enum | SortingMethods { by_name , by_price , by_category , by_quantity , by_upper_limit , by_lower_limit , by_mean , by_sd } |
Functions | |
void | sortStocksList (std::vector< Stock > &stocks_list, SortingMethods sortMethod=by_category, SortingDirections sortDirection=ascending) |
Sorts the stocks. | |
Variables | |
const int | initial_stock_count = 20 |
Initial stock count. | |
const float | STOCK_PRICE_LIMIT = 1000.0f |
The upper limit of the stock price. | |
enum SortingDirections |
enum SortingMethods |
Enumerator | |
---|---|
by_name | |
by_price | |
by_category | |
by_quantity | |
by_upper_limit | |
by_lower_limit | |
by_mean | |
by_sd |
Definition at line 308 of file stock.h.
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 initial_stock_count = 20 |
const float STOCK_PRICE_LIMIT = 1000.0f |
The upper limit of the stock price.
Definition at line 34 of file stock.h.
Referenced by Stock::load(), and Stock::next_round().