Skip to content
This repository was archived by the owner on Jun 12, 2025. It is now read-only.

Commit 9d36250

Browse files
author
Patrick Rye
committed
Update to v4.0.0-beta.9
I finally feel like I'm getting somewhere with these updates! Moved many class members to be private with get / set functions to get / set the values. I left a few not like this because it didn't make sense might change that later. Changed show map to have an edge of 0.
1 parent b1d0901 commit 9d36250

File tree

10 files changed

+264
-130
lines changed

10 files changed

+264
-130
lines changed

Documentation/ChangeLog.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
All notable changes to this project will be documented here.
44
This project adheres to [Semantic Versioning](http://semver.org/)
55

6-
## UNRELEASED [4.0.0] - 2015-08-06 to 2015-08-11
6+
## UNRELEASED [4.0.0] - 2015-08-06 to 2015-08-12
77

88
### Notes
99

1010
* This version has a completely rewritten code; I'll to remember the major things that are different but I may have forgotten stuff.
1111

12-
* The main point of this rewrite was to improve the structure of the code so later changes are easier as opposed to adding a bunch of new features.
12+
* The main point of this rewrite was to improve the structure of the code so later changes are easier as opposed to adding a bunch of new features.
1313

1414
### Removed
1515

@@ -21,7 +21,6 @@ This project adheres to [Semantic Versioning](http://semver.org/)
2121

2222
* The increase chance of the player with the highest fitness being selected over the other players.
2323

24-
2524
### Changed
2625

2726
* Spilt the program into a lot more .cpp to better organize everything
@@ -52,7 +51,9 @@ This project adheres to [Semantic Versioning](http://semver.org/)
5251

5352
* Documentation Folder for documentation
5453

55-
* Basic countdown that will later be a time limit if we decide to implement
54+
* Count down that will kill player when it reaches 0.
55+
56+
* Define of Best Players
5657

5758

5859
## Old versions

Resources/boilerplate.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#include <windows.h>
33
/**********************************************************************************************************************************************/
44
//Verison numbering updated with the file.
5-
#define VER_FILEVERSION 4,0,0,70
6-
#define VER_PRODUCTVERSION "4.0.0-beta.8\0"
5+
#define VER_FILEVERSION 4,0,0,78
6+
#define VER_PRODUCTVERSION "4.0.0-beta.9\0"
77
/**********************************************************************************************************************************************/
88
//If this is not commented out it marks that this program verison was not meant to be publicly released.
99
#define PRIVATE

Source/config.cpp

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,50 @@ void Config::Check(void) {
198198
} //end if exists
199199
}
200200
/**********************************************************************************************************************************************/
201+
Configures Config::getvalues(void) {
202+
return values;
203+
}
204+
/**********************************************************************************************************************************************/
205+
uint Config::getvalues(uchar Spot) {
206+
//Returns just one value from the config.
207+
//Useful when I don't need ALL the values.
208+
switch (Spot) {
209+
case cnfgLogging :
210+
if (values.blnLogging) {return 1;}
211+
else {return 0;}
212+
break;
213+
case cnfgShowMap :
214+
if (values.blnShowMap) {return 1;}
215+
else {return 0;}
216+
break;
217+
case cnfgAppendTime :
218+
if (values.blnAppendTime) {return 1;}
219+
else {return 0;}
220+
break;
221+
case cnfgHardMode :
222+
if (values.blnHardMode) {return 1;}
223+
else {return 0;}
224+
break;
225+
case cnfgFirstGen :
226+
return values.uintFirstGen;
227+
break;
228+
case cnfgGenIncrease :
229+
return values.uintGenIncrease;
230+
break;
231+
case cnfgGensPastGrowth :
232+
return values.uintGensPastGrowth;
233+
break;
234+
case cnfgMutationChance :
235+
return values.uintMutationChance;
236+
break;
237+
case cnfgSeed :
238+
return values.uintSeed;
239+
break;
240+
default :
241+
return 0;
242+
break;
243+
}; //end switch
244+
245+
return 9999;
246+
}
247+
/**********************************************************************************************************************************************/

Source/config.h

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,27 @@ struct ConfigValues {
1616
uint uintMutationChance; //Percent chance that when using directions from a previous player, the direction will be replace with a random one.
1717
uint uintSeed; //The seed that is used with srand()
1818
};
19+
20+
enum configValueSpot {
21+
cnfgLogging = 0,
22+
cnfgShowMap, //1
23+
cnfgAppendTime, //2
24+
cnfgHardMode, //3
25+
cnfgFirstGen, //4
26+
cnfgGenIncrease, //5
27+
cnfgGensPastGrowth, //6
28+
cnfgMutationChance, //7
29+
cnfgSeed //8
30+
};
31+
32+
typedef struct ConfigValues Configures;
1933
/**********************************************************************************************************************************************/
2034
class Config {
2135
private:
2236
//Members
2337
const char* FileName = DEFINED_CONFIG_FILE_NAME;
2438
FILE* configFile;
39+
Configures values;
2540

2641
//Functions
2742
char verisonCheck(const char *ConfigVerison);
@@ -34,11 +49,10 @@ class Config {
3449
Config();
3550
~Config();
3651

37-
//Members
38-
struct ConfigValues values;
39-
4052
//Functions
4153
void Check(void);
54+
Configures getvalues(void); //Get all values
55+
uint getvalues(uchar); //Get just one value (use enum above to define which one).
4256
};
4357
/**********************************************************************************************************************************************/
4458
#endif

0 commit comments

Comments
 (0)