Stock Market Simulator main e8c3612
A game that provides a realistic stock buying experience with unpredictable trends to test investment strategies.
|
The data structure of an event that will be applied to the stocks. More...
#include "events.h"
Public Member Functions | |
bool | operator== (const Stock_event &other) const |
Overload the == operator to compare two Stock_event. | |
Public Attributes | |
unsigned int | category |
unsigned int | duration |
Number of rounds the event will last. | |
unsigned int | event_id |
The id of the event. | |
std::map< stock_modifiers, double > | modifiers |
Stores the stock_modifiers that the event applies. | |
std::vector< unsigned int > | mutually_exclusive_events |
A list of event_ids that this event is mutually exclusive with. | |
unsigned int | probability_permille |
0 to 1000, so 114 means 11.4% | |
std::string | text |
The text that will be displayed to the player. | |
event_type | type_of_event |
The type of event: Apply to all stocks, in one category or randomly? | |
Friends | |
std::ostream & | operator<< (std::ostream &outputstream, const Stock_event &event) |
Serialize the event as std::ostream object. | |
std::istream & | operator>> (std::istream &inputstream, Stock_event &event) |
Deserialize the event from a std::istream object. | |
The data structure of an event that will be applied to the stocks.
|
inline |
Overload the == operator to compare two Stock_event.
Definition at line 135 of file events.h.
References category, event_id, modifiers, probability_permille, text, and type_of_event.
|
friend |
Serialize the event as std::ostream object.
outputstream | The std::ostream object to write the data. |
event | The event object to get the data from. |
Definition at line 154 of file events.h.
|
friend |
Deserialize the event from a std::istream object.
inputstream | The std::istream object to read the data. |
event | The event object to store the data. |
Definition at line 175 of file events.h.
unsigned int Stock_event::category |
Definition at line 129 of file events.h.
Referenced by operator==(), and Stock::setup_STOCK_SPLIT_EVENT().
unsigned int Stock_event::duration |
unsigned int Stock_event::event_id |
The id of the event.
This is still required for checking, despite the fact that we are using a vector.
Definition at line 110 of file events.h.
Referenced by Stock::can_add_event(), and operator==().
std::map<stock_modifiers, double> Stock_event::modifiers |
Stores the stock_modifiers that the event applies.
Definition at line 132 of file events.h.
Referenced by operator==().
std::vector<unsigned int> Stock_event::mutually_exclusive_events |
unsigned int Stock_event::probability_permille |
std::string Stock_event::text |
The text that will be displayed to the player.
Definition at line 116 of file events.h.
Referenced by new_events_next_round(), operator==(), and Stock::setup_STOCK_SPLIT_EVENT().
event_type Stock_event::type_of_event |
The type of event: Apply to all stocks, in one category or randomly?
Definition at line 127 of file events.h.
Referenced by operator==().