Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functionality of reading from a configuration file #35

Open
Ahmed-Khaled-dev opened this issue Apr 21, 2023 · 0 comments
Open

Functionality of reading from a configuration file #35

Ahmed-Khaled-dev opened this issue Apr 21, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Ahmed-Khaled-dev
Copy link
Owner

Ahmed-Khaled-dev commented Apr 21, 2023

Implementing functionality to read from a config/configuration file in our game

Why?

  • It is very beneficial in storing colors, (x, y) coordinates, or any constants inside our code to be stored outside our code in a separate configuration file, where we can easily edit it from there without the need to go into the code and keep search for it (Something like the current dialogue text that is in our code)
  • Config files are best practices and are used 100% of the time when working professionally, so it is a great opportunity for us to learn to work with them, and again they will assist us greatly in creating the levels

Don't know what is a config file?

Config/Configuration files are simply files that contain pre-determined configurations for our app, as mentioned before, colors, text, coordinates, etc

Expectations:

I expect what is said below to be done for EVERY constant in our code, even if they're not set to as constants in our code and are used inside setColor or setPosition or anything like that, create constants for them in the new config file and then include this config file and use the Constants, so I expect to rarely see constant values/number in our code files, they should all be outside the code in the header file (config.h), and please separate the constants inside the config.h file with comments and spaces to specify which constants are related to which components (Levels menu, dialogue box, command line etc.)

I expect a new header file that contains #defines or just const int x = 10; for example in them, an example of how this should work:
Example c++ file:

Example config.h file:

(As I said you can just do)

const string MESSAGE = "Hello world\n"

Example output

@Ahmed-Khaled-dev Ahmed-Khaled-dev added the enhancement New feature or request label Apr 21, 2023
@Ahmed-Khaled-dev Ahmed-Khaled-dev closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants