Stock Market Simulator main e8c3612
A game that provides a realistic stock buying experience with unpredictable trends to test investment strategies.
Loading...
Searching...
No Matches
names.h
Go to the documentation of this file.
1/// @file names.h
2/// Declaration of the name generating function.
3/*
4This program is free software: you can redistribute it and/or modify it under the
5terms of the GNU Lesser General Public License as published by the Free Software
6Foundation, either version 3 of the License, or (at your option) any later version.
7
8This program is distributed in the hope that it will be useful, but WITHOUT ANY
9WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
10PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
11
12You should have received a copy of the GNU Lesser General Public License along with this
13program. If not, see <https://www.gnu.org/licenses/>.
14*/
15#ifndef NAMES_H
16#define NAMES_H
17
18#include <string>
19#include <vector>
20
21/**
22 * @brief The size of the category list.
23 *
24 * This constant represents the size of the category list used in the program.
25 * It is used to determine the number of categories in the list.
26 */
27const int category_list_size = 17;
28
29/**
30 * @brief List of stock categories.
31 * The array category_list is declared as extern since it will be defined in names.cpp.
32 * It is not defined in names.h to avoid multiple definition errors,
33 * and to follow good programming practices.
34 */
35extern const std::string category_list[category_list_size];
36
37std::vector<std::string> generate_name(unsigned int category, unsigned int num);
38
39/**
40 * @brief Generates a vector of company names by combining words and suffixes.
41 * @param num The number of company names to generate.
42 * @param words A vector of words to use in the company names.
43 * @param suffixes A vector of suffixes to use in the company names.
44 * @param companyNames The vector of company names to generate. This vector will be
45 * modified by the function.
46 */
47void pickUniqueNames(const unsigned int & num, const std::vector<std::string> & words,
48 const std::vector<std::string> & suffixes, std::vector<std::string> & companyNames);
49
50#endif
@ category
This event will apply to stocks within the specified category.
Definition events.h:92
void pickUniqueNames(const unsigned int &num, const std::vector< std::string > &words, const std::vector< std::string > &suffixes, std::vector< std::string > &companyNames)
Generates a vector of company names by combining words and suffixes.
Definition names.cpp:314
std::vector< std::string > generate_name(unsigned int category, unsigned int num)
Generates a set of unique stock names based on the specified category and quantity.
Definition names.cpp:37
const int category_list_size
The size of the category list.
Definition names.h:27
const std::string category_list[category_list_size]
List of stock categories.
Definition names.cpp:22